
Ext.DomHelper=function(){
		var tempTableEl=null,
		emptyTags=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
		tableRe=/^table|tbody|tr|td$/i,
		pub,
		afterbegin="afterbegin",
		afterend="afterend",
		beforebegin="beforebegin",
		beforeend="beforeend",
		ts='<table>',
		te='</table>',
		tbs=ts+'<tbody>',
		tbe='</tbody>'+te,
		trs=tbs+'<tr>',
		tre='</tr>'+tbe;
	function doInsert(el,o,returnElement,pos,sibling,append){
		var newNode=pub.insertHtml(pos,Ext.getDom(el),createHtml(o));
		return returnElement?Ext.get(newNode,true):newNode;
	}
	function createHtml(o){
		var b="",
			attr,
			val,
			key,
			keyVal,
			cn;
		if(typeof o=='string'){
			b=o;
		}else if(Ext.isArray(o)){
			Ext.each(o,function(v){
				b+=createHtml(v);
			});
		}else{
			b+="<"+(o.tag=o.tag||"div");
			Ext.iterate(o,function(attr,val){
				if(!/tag|children|cn|html$/i.test(attr)){
					if(Ext.isObject(val)){
						b+=" "+attr+"='";
						Ext.iterate(val,function(key,keyVal){
							b+=key+":"+keyVal+";";
						});
						b+="'";
					}else{
						b+=" "+({cls:"class",htmlFor:"for"}[attr]||attr)+"='"+val+"'";
					}
				}
			});
			if(emptyTags.test(o.tag)){
				b+="/>";
			}else{
				b+=">";
				if((cn=o.children||o.cn)){
					b+=createHtml(cn);
				}else if(o.html){
					b+=o.html;
				}
				b+="</"+o.tag+">";
			}
		}
		return b;
	}
	function ieTable(depth,s,h,e){
		tempTableEl.innerHTML=[s,h,e].join('');
		var i=-1,
			el=tempTableEl;
		while(++i<depth){
			el=el.firstChild;
		}
		return el;
	}
	function insertIntoTable(tag,where,el,html){
		var node,
			before;
		tempTableEl=tempTableEl||document.createElement('div');
		if(tag=='td'&&(where==afterbegin||where==beforeend)||!/td|tr|tbody/i.test(tag)&&(where==beforebegin||where==afterend)){
			return;
		}
		before=where==beforebegin?el:
		 		 where==afterend?el.nextSibling:
				 where==afterbegin?el.firstChild:null;
		if(where==beforebegin||where==afterend){
			el=el.parentNode;
		}
		if(tag=='td'||(tag=="tr"&&(where==beforeend||where==afterbegin))){
			node=ieTable(4,trs,html,tre);
		}else if((tag=="tbody"&&(where==beforeend||where==afterbegin))||(tag=="tr"&&(where==beforebegin||where==afterend))){
			node=ieTable(3,tbs,html,tbe);
		}else{
		 	node=ieTable(2,ts,html,te);
		}
		el.insertBefore(node,before);
		return node;
	}
	pub={
		markup:function(o){
			return createHtml(o);
		},
		insertHtml:function(where,el,html){
			var hash={},
				hashVal,
				setStart,
				range,
				frag,
				rangeEl,
				rs;
			where=where.toLowerCase();
			hash[beforebegin]=['BeforeBegin','previousSibling'];
			hash[afterend]=['AfterEnd','nextSibling'];
			if(el.insertAdjacentHTML){
				if(tableRe.test(el.tagName)&&(rs=insertIntoTable(el.tagName.toLowerCase(),where,el,html))){
					return rs;
				}
				hash[afterbegin]=['AfterBegin','firstChild'];
				hash[beforeend]=['BeforeEnd','lastChild'];
				if((hashVal=hash[where])){
					el.insertAdjacentHTML(hashVal[0],html);
					return el[hashVal[1]];
				}
			}else{
				range=el.ownerDocument.createRange();
				setStart="setStart"+(/end/i.test(where)?"After":"Before");
				if(hash[where]){
				 	range[setStart](el);
				 	frag=range.createContextualFragment(html);
				 	el.parentNode.insertBefore(frag,where==beforebegin?el:el.nextSibling);
				 	return el[(where==beforebegin?"previous":"next")+"Sibling"];
				}else{
					rangeEl=(where==afterbegin?"first":"last")+"Child";
					if(el.firstChild){
						range[setStart](el[rangeEl]);
						frag=range.createContextualFragment(html);
						if(where==afterbegin){
							el.insertBefore(frag,el.firstChild);
						}else{
							el.appendChild(frag);
						}
					}else{
		 				el.innerHTML=html;
	 				}
	 				return el[rangeEl];
				}
			}
			throw'Illegal insertion point -> "'+where+'"';
		},
		insertBefore:function(el,o,returnElement){
			return doInsert(el,o,returnElement,beforebegin);
		},
		insertAfter:function(el,o,returnElement){
			return doInsert(el,o,returnElement,afterend,"nextSibling");
		},
		insertFirst:function(el,o,returnElement){
			return doInsert(el,o,returnElement,afterbegin,"firstChild");
		},
		append:function(el,o,returnElement){
			return doInsert(el,o,returnElement,beforeend,"",true);
		},
		overwrite:function(el,o,returnElement){
			el=Ext.getDom(el);
			el.innerHTML=createHtml(o);
			return returnElement?Ext.get(el.firstChild):el.firstChild;
		},
		createHtml:createHtml
	};
	return pub;
}();

Ext.apply(Ext.DomHelper,
function(){
	var pub,
		afterbegin='afterbegin',
		afterend='afterend',
		beforebegin='beforebegin',
		beforeend='beforeend';
	function doInsert(el,o,returnElement,pos,sibling,append){
		el=Ext.getDom(el);
		var newNode;
		if(pub.useDom){
			newNode=createDom(o,null);
			if(append){
				el.appendChild(newNode);
			}else{
				(sibling=='firstChild'?el:el.parentNode).insertBefore(newNode,el[sibling]||el);
			}
		}else{
			newNode=Ext.DomHelper.insertHtml(pos,el,Ext.DomHelper.createHtml(o));
		}
		return returnElement?Ext.get(newNode,true):newNode;
	}
	function createDom(o,parentNode){
		var el,
			doc=document,
			useSet,
			attr,
			val,
			cn;
		if(Ext.isArray(o)){
			el=doc.createDocumentFragment();
			Ext.each(o,function(v){
				createDom(v,el);
			});
		}else if(Ext.isString(o)){
			el=doc.createTextNode(o);
		}else{
			el=doc.createElement(o.tag||'div');
			useSet=!!el.setAttribute;
			Ext.iterate(o,function(attr,val){
				if(!/tag|children|cn|html|style/.test(attr)){
					if(attr=='cls'){
						el.className=val;
					}else{
						if(useSet){
							el.setAttribute(attr,val);
						}else{
							el[attr]=val;
						}
					}
				}
			});
			pub.applyStyles(el,o.style);
			if((cn=o.children||o.cn)){
				createDom(cn,el);
			}else if(o.html){
				el.innerHTML=o.html;
			}
		}
		if(parentNode){
			parentNode.appendChild(el);
		}
		return el;
	}
	pub={
		createTemplate:function(o){
			var html=Ext.DomHelper.createHtml(o);
			return new Ext.Template(html);
		},
		useDom:false,
		applyStyles:function(el,styles){
			if(styles){
				var i=0,
					len,
					style;
				el=Ext.fly(el);
				if(Ext.isFunction(styles)){
					styles=styles.call();
				}
				if(Ext.isString(styles)){
					styles=styles.trim().split(/\s*(?::|;)\s*/);
					for(len=styles.length;i<len;){
						el.setStyle(styles[i++],styles[i++]);
					}
				}else if(Ext.isObject(styles)){
					el.setStyle(styles);
				}
			}
		},
		insertBefore:function(el,o,returnElement){
			return doInsert(el,o,returnElement,beforebegin);
		},
		insertAfter:function(el,o,returnElement){
			return doInsert(el,o,returnElement,afterend,'nextSibling');
		},
		insertFirst:function(el,o,returnElement){
			return doInsert(el,o,returnElement,afterbegin,'firstChild');
		},
		append:function(el,o,returnElement){
			return doInsert(el,o,returnElement,beforeend,'',true);
		},
		createDom:createDom
	};
	return pub;}());
Ext.Template=function(html){
	var me=this,
		a=arguments,
		buf=[];
	if(Ext.isArray(html)){
		html=html.join("");
	}else if(a.length>1){
		Ext.each(a,function(v){
			if(Ext.isObject(v)){
				Ext.apply(me,v);
			}else{
				buf.push(v);
			}
		});
		html=buf.join('');
	}
	me.html=html;
	if(me.compiled){
		me.compile();
	}};
Ext.Template.prototype={
	applyTemplate:function(values){
		var me=this;
		return me.compiled?
				me.compiled(values):
				me.html.replace(me.re,function(m,name){
					return values[name]!==undefined?values[name]:"";
				});
	},
	set:function(html,compile){
		var me=this;
		me.html=html;
		me.compiled=null;
		return compile?me.compile():me;
	},
	re:/\{([\w-]+)\}/g,
	compile:function(){
		var me=this,
			sep=Ext.isGecko?"+":",";
		function fn(m,name){
			name="values['"+name+"']";
			return"'"+sep+'('+name+" == undefined ? '' : "+name+')'+sep+"'";
		}
		eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+
			 me.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+
			(Ext.isGecko?"';};":"'].join('');};"));
		return me;
	},
	insertFirst:function(el,values,returnElement){
		return this.doInsert('afterBegin',el,values,returnElement);
	},
	insertBefore:function(el,values,returnElement){
		return this.doInsert('beforeBegin',el,values,returnElement);
	},
	insertAfter:function(el,values,returnElement){
		return this.doInsert('afterEnd',el,values,returnElement);
	},
	append:function(el,values,returnElement){
		return this.doInsert('beforeEnd',el,values,returnElement);
	},
	doInsert:function(where,el,values,returnEl){
		el=Ext.getDom(el);
		var newNode=Ext.DomHelper.insertHtml(where,el,this.applyTemplate(values));
		return returnEl?Ext.get(newNode,true):newNode;
	},
	overwrite:function(el,values,returnElement){
		el=Ext.getDom(el);
		el.innerHTML=this.applyTemplate(values);
		return returnElement?Ext.get(el.firstChild,true):el.firstChild;
	}};
Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;
Ext.Template.from=function(el,config){
	el=Ext.getDom(el);
	return new Ext.Template(el.value||el.innerHTML,config||'');};
Ext.apply(Ext.Template.prototype,{
	applyTemplate:function(values){
		var me=this,
			useF=me.disableFormats!==true,
			fm=Ext.util.Format,
			tpl=me;
		if(me.compiled){
			return me.compiled(values);
		}
		function fn(m,name,format,args){
			if(format&&useF){
				if(format.substr(0,5)=="this."){
					return tpl.call(format.substr(5),values[name],values);
				}else{
					if(args){
						var re=/^\s*['"](.*)["']\s*$/;
						args=args.split(',');
						for(var i=0,len=args.length;i<len;i++){
							args[i]=args[i].replace(re,"$1");
						}
						args=[values[name]].concat(args);
					}else{
						args=[values[name]];
					}
					return fm[format].apply(fm,args);
				}
			}else{
				return values[name]!==undefined?values[name]:"";
			}
		}
		return me.html.replace(me.re,fn);
	},
	disableFormats:false,
	re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
	compile:function(){
		var me=this,
			fm=Ext.util.Format,
			useF=me.disableFormats!==true,
			sep=Ext.isGecko?"+":",",
			body;
		function fn(m,name,format,args){
			if(format&&useF){
				args=args?','+args:"";
				if(format.substr(0,5)!="this."){
					format="fm."+format+'(';
				}else{
					format='this.call("'+format.substr(5)+'", ';
					args=", values";
				}
			}else{
				args='';format="(values['"+name+"'] == undefined ? '' : ";
			}
			return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'";
		}
		if(Ext.isGecko){
			body="this.compiled = function(values){ return '"+
				me.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+
					"';};";
		}else{
			body=["this.compiled = function(values){ return ['"];
			body.push(me.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));
			body.push("'].join('');};");
			body=body.join('');
		}
		eval(body);
		return me;
	},
	call:function(fnName,value,allValues){
		return this[fnName](value,allValues);
	}});
Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;
Ext.DomQuery=function(){
	var cache={},
		simpleCache={},
		valueCache={},
		nonSpace=/\S/,
		trimRe=/^\s+|\s+$/g,
		tplRe=/\{(\d+)\}/g,
		modeRe=/^(\s?[\/>+~]\s?|\s|$)/,
		tagTokenRe=/^(#)?([\w-\*]+)/,
		nthRe=/(\d*)n\+?(\d*)/,
		nthRe2=/\D/,
		isIE=window.ActiveXObject?true:false,
		isOpera=Ext.isOpera,
		key=30803;
	eval("var batch = 30803;");
	function child(p,index){
		var i=0,
			n=p.firstChild;
		while(n){
			if(n.nodeType==1){
				if(++i==index){
					return n;
				}
			}
			n=n.nextSibling;
		}
		return null;
	};
	function next(n){
		while((n=n.nextSibling)&&n.nodeType!=1);
		return n;
	};
	function prev(n){
		while((n=n.previousSibling)&&n.nodeType!=1);
		return n;
	};
	function children(d){
		var n=d.firstChild,ni=-1,
			nx;
		while(n){
			nx=n.nextSibling;
			if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){
				d.removeChild(n);
			}else{
				n.nodeIndex=++ni;
			}
			n=nx;
		}
		return this;
	};
	function byClassName(c,a,v){
		if(!v){
			return c;
		}
		var r=[],ri=-1,cn;
		for(var i=0,ci;ci=c[i];i++){
			if((' '+ci.className+' ').indexOf(v)!=-1){
				r[++ri]=ci;
			}
		}
		return r;
	};
	function attrValue(n,attr){
		if(!n.tagName&&typeof n.length!="undefined"){
			n=n[0];
		}
		if(!n){
			return null;
		}
		if(attr=="for"){
			return n.htmlFor;
		}
		if(attr=="class"||attr=="className"){
			return n.className;
		}
		return n.getAttribute(attr)||n[attr];
	};
	function getNodes(ns,mode,tagName){
		var result=[],ri=-1,cs;
		if(!ns){
			return result;
		}
		tagName=tagName||"*";
		if(typeof ns.getElementsByTagName!="undefined"){
			ns=[ns];
		}
		if(!mode){
			for(var i=0,ni;ni=ns[i];i++){
				cs=ni.getElementsByTagName(tagName);
				for(var j=0,ci;ci=cs[j];j++){
					result[++ri]=ci;
				}
			}
		}else if(mode=="/"||mode==">"){
			var utag=tagName.toUpperCase();
			for(var i=0,ni,cn;ni=ns[i];i++){
				cn=isOpera?ni.childNodes:(ni.children||ni.childNodes);
				for(var j=0,cj;cj=cn[j];j++){
					if(cj.nodeName==utag||cj.nodeName==tagName||tagName=='*'){
						result[++ri]=cj;
					}
				}
			}
		}else if(mode=="+"){
			var utag=tagName.toUpperCase();
			for(var i=0,n;n=ns[i];i++){
				while((n=n.nextSibling)&&n.nodeType!=1);
				if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=='*')){
					result[++ri]=n;
				}
			}
		}else if(mode=="~"){
			var utag=tagName.toUpperCase();
			for(var i=0,n;n=ns[i];i++){
				while((n=n.nextSibling)){
					if(n.nodeName==utag||n.nodeName==tagName||tagName=='*'){
						result[++ri]=n;
					}
				}
			}
		}
		return result;
	};
	function concat(a,b){
		if(b.slice){
			return a.concat(b);
		}
		for(var i=0,l=b.length;i<l;i++){
			a[a.length]=b[i];
		}
		return a;
	}
	function byTag(cs,tagName){
		if(cs.tagName||cs==document){
			cs=[cs];
		}
		if(!tagName){
			return cs;
		}
		var r=[],ri=-1;
		tagName=tagName.toLowerCase();
		for(var i=0,ci;ci=cs[i];i++){
			if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){
				r[++ri]=ci;
			}
		}
		return r;
	};
	function byId(cs,attr,id){
		if(cs.tagName||cs==document){
			cs=[cs];
		}
		if(!id){
			return cs;
		}
		var r=[],ri=-1;
		for(var i=0,ci;ci=cs[i];i++){
			if(ci&&ci.id==id){
				r[++ri]=ci;
				return r;
			}
		}
		return r;
	};
	function byAttribute(cs,attr,value,op,custom){
		var r=[],
			ri=-1,
			st=custom=="{",
			f=Ext.DomQuery.operators[op];
		for(var i=0,ci;ci=cs[i];i++){
			if(ci.nodeType!=1){
				continue;
			}
			var a;
			if(st){
				a=Ext.DomQuery.getStyle(ci,attr);
			}
			else if(attr=="class"||attr=="className"){
				a=ci.className;
			}else if(attr=="for"){
				a=ci.htmlFor;
			}else if(attr=="href"){
				a=ci.getAttribute("href",2);
			}else{
				a=ci.getAttribute(attr);
			}
			if((f&&f(a,value))||(!f&&a)){
				r[++ri]=ci;
			}
		}
		return r;
	};
	function byPseudo(cs,name,value){
		return Ext.DomQuery.pseudos[name](cs,value);
	};
	function nodupIEXml(cs){
		var d=++key,
			r;
		cs[0].setAttribute("_nodup",d);
		r=[cs[0]];
		for(var i=1,len=cs.length;i<len;i++){
			var c=cs[i];
			if(!c.getAttribute("_nodup")!=d){
				c.setAttribute("_nodup",d);
				r[r.length]=c;
			}
		}
		for(var i=0,len=cs.length;i<len;i++){
			cs[i].removeAttribute("_nodup");
		}
		return r;
	}
	function nodup(cs){
		if(!cs){
			return[];
		}
		var len=cs.length,c,i,r=cs,cj,ri=-1;
		if(!len||typeof cs.nodeType!="undefined"||len==1){
			return cs;
		}
		if(isIE&&typeof cs[0].selectSingleNode!="undefined"){
			return nodupIEXml(cs);
		}
		var d=++key;
		cs[0]._nodup=d;
		for(i=1;c=cs[i];i++){
			if(c._nodup!=d){
				c._nodup=d;
			}else{
				r=[];
				for(var j=0;j<i;j++){
					r[++ri]=cs[j];
				}
				for(j=i+1;cj=cs[j];j++){
					if(cj._nodup!=d){
						cj._nodup=d;
						r[++ri]=cj;
					}
				}
				return r;
			}
		}
		return r;
	}
	function quickDiffIEXml(c1,c2){
		var d=++key,
			r=[];
		for(var i=0,len=c1.length;i<len;i++){
			c1[i].setAttribute("_qdiff",d);
		}
		for(var i=0,len=c2.length;i<len;i++){
			if(c2[i].getAttribute("_qdiff")!=d){
				r[r.length]=c2[i];
			}
		}
		for(var i=0,len=c1.length;i<len;i++){
			c1[i].removeAttribute("_qdiff");
		}
		return r;
	}
	function quickDiff(c1,c2){
		var len1=c1.length,
			d=++key,
			r=[];
		if(!len1){
			return c2;
		}
		if(isIE&&c1[0].selectSingleNode){
			return quickDiffIEXml(c1,c2);
		}
		for(var i=0;i<len1;i++){
			c1[i]._qdiff=d;
		}
		for(var i=0,len=c2.length;i<len;i++){
			if(c2[i]._qdiff!=d){
				r[r.length]=c2[i];
			}
		}
		return r;
	}
	function quickId(ns,mode,root,id){
		if(ns==root){
			var d=root.ownerDocument||root;
			return d.getElementById(id);
		}
		ns=getNodes(ns,mode,"*");
		return byId(ns,null,id);
	}
	return{
		getStyle:function(el,name){
			return Ext.fly(el).getStyle(name);
		},
		compile:function(path,type){
			type=type||"select";
			var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],
				q=path,mode,lq,
				tk=Ext.DomQuery.matchers,
				tklen=tk.length,
				mm,
				lmode=q.match(modeRe);
			if(lmode&&lmode[1]){
				fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';
				q=q.replace(lmode[1],"");
			}
			while(path.substr(0,1)=="/"){
				path=path.substr(1);
			}
			while(q&&lq!=q){
				lq=q;
				var tm=q.match(tagTokenRe);
				if(type=="select"){
					if(tm){
						if(tm[1]=="#"){
							fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");';
						}else{
							fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");';
						}
						q=q.replace(tm[0],"");
					}else if(q.substr(0,1)!='@'){
						fn[fn.length]='n = getNodes(n, mode, "*");';
					}
				}else{
					if(tm){
						if(tm[1]=="#"){
							fn[fn.length]='n = byId(n, null, "'+tm[2]+'");';
						}else{
							fn[fn.length]='n = byTag(n, "'+tm[2]+'");';
						}
						q=q.replace(tm[0],"");
					}
				}
				while(!(mm=q.match(modeRe))){
					var matched=false;
					for(var j=0;j<tklen;j++){
						var t=tk[j];
						var m=q.match(t.re);
						if(m){
							fn[fn.length]=t.select.replace(tplRe,function(x,i){
													return m[i];
												});
							q=q.replace(m[0],"");
							matched=true;
							break;
						}
					}
					if(!matched){
						throw'Error parsing selector, parsing failed at "'+q+'"';
					}
				}
				if(mm[1]){
					fn[fn.length]='mode="'+mm[1].replace(trimRe,"")+'";';
					q=q.replace(mm[1],"");
				}
			}
			fn[fn.length]="return nodup(n);\n}";
			eval(fn.join(""));
			return f;
		},
		select:function(path,root,type){
			if(!root||root==document){
				root=document;
			}
			if(typeof root=="string"){
				root=document.getElementById(root);
			}
			var paths=path.split(","),
				results=[];
			for(var i=0,len=paths.length;i<len;i++){
				var p=paths[i].replace(trimRe,"");
				if(!cache[p]){
					cache[p]=Ext.DomQuery.compile(p);
					if(!cache[p]){
						throw p+" is not a valid selector";
					}
				}
				var result=cache[p](root);
				if(result&&result!=document){
					results=results.concat(result);
				}
			}
			if(paths.length>1){
				return nodup(results);
			}
			return results;
		},
		selectNode:function(path,root){
			return Ext.DomQuery.select(path,root)[0];
		},
		selectValue:function(path,root,defaultValue){
			path=path.replace(trimRe,"");
			if(!valueCache[path]){
				valueCache[path]=Ext.DomQuery.compile(path,"select");
			}
			var n=valueCache[path](root),
				v;
			n=n[0]?n[0]:n;
			v=(n&&n.firstChild?n.firstChild.nodeValue:null);
			return((v===null||v===undefined||v==='')?defaultValue:v);
		},
		selectNumber:function(path,root,defaultValue){
			var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);
			return parseFloat(v);
		},
		is:function(el,ss){
			if(typeof el=="string"){
				el=document.getElementById(el);
			}
			var isArray=Ext.isArray(el),
				result=Ext.DomQuery.filter(isArray?el:[el],ss);
			return isArray?(result.length==el.length):(result.length>0);
		},
		filter:function(els,ss,nonMatches){
			ss=ss.replace(trimRe,"");
			if(!simpleCache[ss]){
				simpleCache[ss]=Ext.DomQuery.compile(ss,"simple");
			}
			var result=simpleCache[ss](els);
			return nonMatches?quickDiff(result,els):result;
		},
		matchers:[{
				re:/^\.([\w-]+)/,
				select:'n = byClassName(n, null, " {1} ");'
			},{
				re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
				select:'n = byPseudo(n, "{1}", "{2}");'
			},{
				re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
				select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
			},{
				re:/^#([\w-]+)/,
				select:'n = byId(n, null, "{1}");'
			},{
				re:/^@([\w-]+)/,
				select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
			}
		],
		operators:{
			"=":function(a,v){
				return a==v;
			},
			"!=":function(a,v){
				return a!=v;
			},
			"^=":function(a,v){
				return a&&a.substr(0,v.length)==v;
			},
			"$=":function(a,v){
				return a&&a.substr(a.length-v.length)==v;
			},
			"*=":function(a,v){
				return a&&a.indexOf(v)!==-1;
			},
			"%=":function(a,v){
				return(a%v)==0;
			},
			"|=":function(a,v){
				return a&&(a==v||a.substr(0,v.length+1)==v+'-');
			},
			"~=":function(a,v){
				return a&&(' '+a+' ').indexOf(' '+v+' ')!=-1;
			}
		},
		pseudos:{
			"first-child":function(c){
				var r=[],ri=-1,n;
				for(var i=0,ci;ci=n=c[i];i++){
					while((n=n.previousSibling)&&n.nodeType!=1);
					if(!n){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"last-child":function(c){
				var r=[],ri=-1,n;
				for(var i=0,ci;ci=n=c[i];i++){
					while((n=n.nextSibling)&&n.nodeType!=1);
					if(!n){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"nth-child":function(c,a){
				var r=[],ri=-1,
					m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a),
					f=(m[1]||1)-0,l=m[2]-0;
				for(var i=0,n;n=c[i];i++){
					var pn=n.parentNode;
					if(batch!=pn._batch){
						var j=0;
						for(var cn=pn.firstChild;cn;cn=cn.nextSibling){
							if(cn.nodeType==1){
								cn.nodeIndex=++j;
							}
						}
						pn._batch=batch;
					}
					if(f==1){
						if(l==0||n.nodeIndex==l){
							r[++ri]=n;
						}
					}else if((n.nodeIndex+l)%f==0){
						r[++ri]=n;
					}
				}
				return r;
			},
			"only-child":function(c){
				var r=[],ri=-1;;
				for(var i=0,ci;ci=c[i];i++){
					if(!prev(ci)&&!next(ci)){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"empty":function(c){
				var r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					var cns=ci.childNodes,j=0,cn,empty=true;
					while(cn=cns[j]){
						++j;
						if(cn.nodeType==1||cn.nodeType==3){
							empty=false;
							break;
						}
					}
					if(empty){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"contains":function(c,v){
				var r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					if((ci.textContent||ci.innerText||'').indexOf(v)!=-1){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"nodeValue":function(c,v){
				var r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					if(ci.firstChild&&ci.firstChild.nodeValue==v){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"checked":function(c){
				var r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					if(ci.checked==true){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"not":function(c,ss){
				return Ext.DomQuery.filter(c,ss,true);
			},
			"any":function(c,selectors){
				var ss=selectors.split('|'),
					r=[],ri=-1,s;
				for(var i=0,ci;ci=c[i];i++){
					for(var j=0;s=ss[j];j++){
						if(Ext.DomQuery.is(ci,s)){
							r[++ri]=ci;
							break;
						}
					}
				}
				return r;
			},
			"odd":function(c){
				return this["nth-child"](c,"odd");
			},
			"even":function(c){
				return this["nth-child"](c,"even");
			},
			"nth":function(c,a){
				return c[a-1]||[];
			},
			"first":function(c){
				return c[0]||[];
			},
			"last":function(c){
				return c[c.length-1]||[];
			},
			"has":function(c,ss){
				var s=Ext.DomQuery.select,
					r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					if(s(ss,ci).length>0){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"next":function(c,ss){
				var is=Ext.DomQuery.is,
					r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					var n=next(ci);
					if(n&&is(n,ss)){
						r[++ri]=ci;
					}
				}
				return r;
			},
			"prev":function(c,ss){
				var is=Ext.DomQuery.is,
					r=[],ri=-1;
				for(var i=0,ci;ci=c[i];i++){
					var n=prev(ci);
					if(n&&is(n,ss)){
						r[++ri]=ci;
					}
				}
				return r;
			}
		}
	};}();
Ext.query=Ext.DomQuery.select;
(function(){
var EXTUTIL=Ext.util,
	TOARRAY=Ext.toArray,
	EACH=Ext.each,
	ISOBJECT=Ext.isObject,
	TRUE=true,
	FALSE=false;
EXTUTIL.Observable=function(){
	var me=this,e=me.events;
	if(me.listeners){
		me.on(me.listeners);
		delete me.listeners;
	}
	me.events=e||{};};
EXTUTIL.Observable.prototype=function(){
	var filterOptRe=/^(?:scope|delay|buffer|single)$/,toLower=function(s){
		return s.toLowerCase();
	};
	return{
		fireEvent:function(){
			var a=TOARRAY(arguments),
				ename=toLower(a[0]),
				me=this,
				ret=TRUE,
				ce=me.events[ename],
				q,
				c;
			if(me.eventsSuspended===TRUE){
				if(q=me.suspendedEventsQueue){
					q.push(a);
				}
			}
			else if(ISOBJECT(ce)&&ce.bubble){
				if(ce.fire.apply(ce,a.slice(1))===FALSE){
					return FALSE;
				}
				c=me.getBubbleTarget&&me.getBubbleTarget();
				if(c&&c.enableBubble){
					c.enableBubble(ename);
					return c.fireEvent.apply(c,a);
				}
			}
			else{
				if(ISOBJECT(ce)){
					a.shift();
					ret=ce.fire.apply(ce,a);
				}
			}
			return ret;
		},
		addListener:function(eventName,fn,scope,o){
			var me=this,
				e,
				oe,
				isF,
			ce;
			if(ISOBJECT(eventName)){
				o=eventName;
				for(e in o){
					oe=o[e];
					if(!filterOptRe.test(e)){
						me.addListener(e,oe.fn||oe,oe.scope||o.scope,oe.fn?oe:o);
					}
				}
			}else{
				eventName=toLower(eventName);
				ce=me.events[eventName]||TRUE;
				if(typeof ce=="boolean"){
					me.events[eventName]=ce=new EXTUTIL.Event(me,eventName);
				}
				ce.addListener(fn,scope,ISOBJECT(o)?o:{});
			}
		},
		removeListener:function(eventName,fn,scope){
			var ce=this.events[toLower(eventName)];
			if(ISOBJECT(ce)){
				ce.removeListener(fn,scope);
			}
		},
		purgeListeners:function(){
			var events=this.events,
				evt,
				key;
			for(key in events){
				evt=events[key];
				if(ISOBJECT(evt)){
					evt.clearListeners();
				}
			}
		},
		addEvents:function(o){
			var me=this;
			me.events=me.events||{};
			if(typeof o=='string'){
				EACH(arguments,function(a){
					me.events[a]=me.events[a]||TRUE;
				});
			}else{
				Ext.applyIf(me.events,o);
			}
		},
		hasListener:function(eventName){
			var e=this.events[eventName];
			return ISOBJECT(e)&&e.listeners.length>0;
		},
		suspendEvents:function(queueSuspended){
			this.eventsSuspended=TRUE;
			if(queueSuspended){
				this.suspendedEventsQueue=[];
			}
		},
		resumeEvents:function(){
			var me=this;
			me.eventsSuspended=!delete me.suspendedEventQueue;
			EACH(me.suspendedEventsQueue,function(e){
				me.fireEvent.apply(me,e);
			});
		}
	}}();
var OBSERVABLE=EXTUTIL.Observable.prototype;
OBSERVABLE.on=OBSERVABLE.addListener;
OBSERVABLE.un=OBSERVABLE.removeListener;
EXTUTIL.Observable.releaseCapture=function(o){
	o.fireEvent=OBSERVABLE.fireEvent;};
function createTargeted(h,o,scope){
	return function(){
		if(o.target==arguments[0]){
			h.apply(scope,TOARRAY(arguments));
		}
	};};
function createBuffered(h,o,scope){
	var task=new EXTUTIL.DelayedTask();
	return function(){
		task.delay(o.buffer,h,scope,TOARRAY(arguments));
	};}
function createSingle(h,e,fn,scope){
	return function(){
		e.removeListener(fn,scope);
		return h.apply(scope,arguments);
	};}
function createDelayed(h,o,scope){
	return function(){
		var args=TOARRAY(arguments);
		(function(){
			h.apply(scope,args);
		}).defer(o.delay||10);
	};};
EXTUTIL.Event=function(obj,name){
	this.name=name;
	this.obj=obj;
	this.listeners=[];};
EXTUTIL.Event.prototype={
	addListener:function(fn,scope,options){
		var me=this,
			l;
		scope=scope||me.obj;
		if(!me.isListening(fn,scope)){
			l=me.createListener(fn,scope,options);
			if(me.firing){
				me.listeners=me.listeners.slice(0);
			}
			me.listeners.push(l);
		}
	},
	createListener:function(fn,scope,o){
		o=o||{},scope=scope||this.obj;
		var l={
			fn:fn,
			scope:scope,
			options:o
		},h=fn;
		if(o.target){
			h=createTargeted(h,o,scope);
		}
		if(o.delay){
			h=createDelayed(h,o,scope);
		}
		if(o.single){
			h=createSingle(h,this,fn,scope);
		}
		if(o.buffer){
			h=createBuffered(h,o,scope);
		}
		l.fireFn=h;
		return l;
	},
	findListener:function(fn,scope){
		var s,ret=-1;
		EACH(this.listeners,function(l,i){
			s=l.scope;
			if(l.fn==fn&&(s==scope||s==this.obj)){
				ret=i;
				return FALSE;
			}
		},
		this);
		return ret;
	},
	isListening:function(fn,scope){
		return this.findListener(fn,scope)!=-1;
	},
	removeListener:function(fn,scope){
		var index,
			me=this,
			ret=FALSE;
		if((index=me.findListener(fn,scope))!=-1){
			if(me.firing){
				me.listeners=me.listeners.slice(0);
			}
			me.listeners.splice(index,1);
			ret=TRUE;
		}
		return ret;
	},
	clearListeners:function(){
		this.listeners=[];
	},
	fire:function(){
		var me=this,
			args=TOARRAY(arguments),
			ret=TRUE;
		EACH(me.listeners,function(l){
			me.firing=TRUE;
			if(l.fireFn.apply(l.scope||me.obj||window,args)===FALSE){
				return ret=me.firing=FALSE;
			}
		});
		me.firing=FALSE;
		return ret;
	}};})();
Ext.apply(Ext.util.Observable.prototype,function(){
	function getMethodEvent(method){
		var e=(this.methodEvents=this.methodEvents||
		{})[method],returnValue,v,cancel,obj=this;
		if(!e){
			this.methodEvents[method]=e={};
			e.originalFn=this[method];
			e.methodName=method;
			e.before=[];
			e.after=[];
			var makeCall=function(fn,scope,args){
				if(!Ext.isEmpty(v=fn.apply(scope||obj,args))){
					if(Ext.isObject(v)){
						returnValue=!Ext.isEmpty(v.returnValue)?v.returnValue:v;
						cancel=!!v.cancel;
					}
					else
						if(v===false){
							cancel=true;
						}
						else{
							returnValue=v;
						}
				}
			};
			this[method]=function(){
				var args=Ext.toArray(arguments);
				returnValue=v=undefined;
				cancel=false;
				Ext.each(e.before,function(b){
					makeCall(b.fn,b.scope,args);
					if(cancel){
						return returnValue;
					}
				});
				if(!Ext.isEmpty(v=e.originalFn.apply(obj,args))){
					returnValue=v;
				}
				Ext.each(e.after,function(a){
					makeCall(a.fn,a.scope,args);
					if(cancel){
						return returnValue;
					}
				});
				return returnValue;
			};
		}
		return e;
	}
	return{
		beforeMethod:function(method,fn,scope){
			getMethodEvent.call(this,method).before.push({
				fn:fn,
				scope:scope
			});
		},
		afterMethod:function(method,fn,scope){
			getMethodEvent.call(this,method).after.push({
				fn:fn,
				scope:scope
			});
		},
		removeMethodListener:function(method,fn,scope){
			var e=getMethodEvent.call(this,method),found=false;
			Ext.each(e.before,function(b,i,arr){
				if(b.fn==fn&&b.scope==scope){
					arr.splice(i,1);
					found=true;
					return false;
				}
			});
			if(!found){
				Ext.each(e.after,function(a,i,arr){
					if(a.fn==fn&&a.scope==scope){
						arr.splice(i,1);
						return false;
					}
				});
			}
		},
		relayEvents:function(o,events){
			var me=this;
			function createHandler(ename){
				return function(){
					return me.fireEvent.apply(me,[ename].concat(Ext.toArray(arguments)));
				};
			}
			Ext.each(events,function(ename){
				me.events[ename]=me.events[ename]||true;
				o.on(ename,createHandler(ename),me);
			});
		},
		enableBubble:function(events){
			var me=this;
			events=Ext.isArray(events)?events:Ext.toArray(arguments);
			Ext.each(events,function(ename){
				ename=ename.toLowerCase();
				var ce=me.events[ename]||true;
				if(typeof ce=="boolean"){
					ce=new Ext.util.Event(me,ename);
					me.events[ename]=ce;
				}
				ce.bubble=true;
			});
		}
	};}());
Ext.util.Observable.capture=function(o,fn,scope){
	o.fireEvent=o.fireEvent.createInterceptor(fn,scope);};
Ext.util.Observable.observeClass=function(c){
	Ext.apply(c,new Ext.util.Observable());
	c.prototype.fireEvent=function(){
		return(c.fireEvent.apply(c,arguments)!==false)&&
		(Ext.util.Observable.prototype.fireEvent.apply(this,arguments)!==false);
	};};
Ext.EventManager=function(){
	var docReadyEvent,
		docReadyProcId,
		docReadyState=false,
		E=Ext.lib.Event,
		D=Ext.lib.Dom,
		DOC=document,
		WINDOW=window,
		IEDEFERED="ie-deferred-loader",
		DOMCONTENTLOADED="DOMContentLoaded",
		elHash={},
		propRe=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
	function addListener(el,ename,fn,wrap,scope){
		var id=Ext.id(el),
			es=elHash[id]=elHash[id]||{};
		(es[ename]=es[ename]||[]).push([fn,wrap,scope]);
		E.on(el,ename,wrap);
		if(ename=="mousewheel"&&el.addEventListener){
			var args=["DOMMouseScroll",wrap,false];
			el.addEventListener.apply(el,args);
			E.on(window,'unload',function(){
				el.removeEventListener.apply(el,args);
			});
		}
		if(ename=="mousedown"&&el==document){
			Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);
		}
	};
	function fireDocReady(){
		if(!docReadyState){
			Ext.isReady=docReadyState=true;
			if(docReadyProcId){
				clearInterval(docReadyProcId);
			}
			if(Ext.isGecko||Ext.isOpera){
				DOC.removeEventListener(DOMCONTENTLOADED,fireDocReady,false);
			}
			if(Ext.isIE){
				var defer=DOC.getElementById(IEDEFERED);
				if(defer){
					defer.onreadystatechange=null;
					defer.parentNode.removeChild(defer);
				}
			}
			if(docReadyEvent){
				docReadyEvent.fire();
				docReadyEvent.clearListeners();
			}
		}
	};
	function initDocReady(){
		var COMPLETE="complete";
		docReadyEvent=new Ext.util.Event();
		if(Ext.isGecko||Ext.isOpera){
			DOC.addEventListener(DOMCONTENTLOADED,fireDocReady,false);
		}else if(Ext.isIE){
			DOC.write("<s"+'cript id='+IEDEFERED+' defer="defer" src="/'+'/:"></s'+"cript>");
			DOC.getElementById(IEDEFERED).onreadystatechange=function(){
				if(this.readyState==COMPLETE){
					fireDocReady();
				}
			};
		}else if(Ext.isWebKit){
			docReadyProcId=setInterval(function(){
				if(DOC.readyState==COMPLETE){
					fireDocReady();
				}
			},10);
		}
		E.on(WINDOW,"load",fireDocReady);
	};
	function createTargeted(h,o){
		return function(){
			var args=Ext.toArray(arguments);
			if(o.target==Ext.EventObject.setEvent(args[0]).target){
				h.apply(this,args);
			}
		};
	};
	function createBuffered(h,o){
		var task=new Ext.util.DelayedTask(h);
		return function(e){
			task.delay(o.buffer,h,null,[new Ext.EventObjectImpl(e)]);
		};
	};
	function createSingle(h,el,ename,fn,scope){
		return function(e){
			Ext.EventManager.removeListener(el,ename,fn,scope);
			h(e);
		};
	};
	function createDelayed(h,o){
		return function(e){
			e=new Ext.EventObjectImpl(e);
			setTimeout(function(){
				h(e);
			},o.delay||10);
		};
	};
	function listen(element,ename,opt,fn,scope){
		var o=!Ext.isObject(opt)?{}:opt,
			el=Ext.getDom(element);
		fn=fn||o.fn;
		scope=scope||o.scope;
		if(!el){
			throw"Error listening for \""+ename+'\". Element "'+element+'" doesn\'t exist.';
		}
		function h(e){
			if(!Ext){
				return;
			}
			e=Ext.EventObject.setEvent(e);
			var t;
			if(o.delegate){
				if(!(t=e.getTarget(o.delegate,el))){
					return;
				}
			}else{
				t=e.target;
			}
			if(o.stopEvent){
				e.stopEvent();
			}
			if(o.preventDefault){
				e.preventDefault();
			}
			if(o.stopPropagation){
				e.stopPropagation();
			}
			if(o.normalized){
				e=e.browserEvent;
			}
			fn.call(scope||el,e,t,o);
		};
		if(o.target){
			h=createTargeted(h,o);
		}
		if(o.delay){
			h=createDelayed(h,o);
		}
		if(o.single){
			h=createSingle(h,el,ename,fn,scope);
		}
		if(o.buffer){
			h=createBuffered(h,o);
		}
		addListener(el,ename,fn,h,scope);
		return h;
	};
	var pub={
		addListener:function(element,eventName,fn,scope,options){
			if(Ext.isObject(eventName)){
				var o=eventName,e,val;
				for(e in o){
					val=o[e];
					if(!propRe.test(e)){
						if(Ext.isFunction(val)){
							listen(element,e,o,val,o.scope);
						}else{
							listen(element,e,val);
						}
					}
				}
			}else{
				listen(element,eventName,options,fn,scope);
			}
		},
		removeListener:function(element,eventName,fn,scope){
			var el=Ext.getDom(element),
				id=Ext.id(el),
				wrap;
			Ext.each((elHash[id]||{})[eventName],function(v,i,a){
				if(Ext.isArray(v)&&v[0]==fn&&(!scope||v[2]==scope)){
					E.un(el,eventName,wrap=v[1]);
					a.splice(i,1);
					return false;
				}
			});
			if(eventName=="mousewheel"&&el.addEventListener&&wrap){
				el.removeEventListener("DOMMouseScroll",wrap,false);
			}
			if(eventName=="mousedown"&&el==DOC&&wrap){
				Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap);
			}
		},
		removeAll:function(el){
			var id=Ext.id(el=Ext.getDom(el)),
				es=elHash[id],
				ename;
			for(ename in es){
				if(es.hasOwnProperty(ename)){
					Ext.each(es[ename],function(v){
						E.un(el,ename,v.wrap);
					});
				}
			}
			elHash[id]=null;
		},
		onDocumentReady:function(fn,scope,options){
			if(docReadyState){
				docReadyEvent.addListener(fn,scope,options);
				docReadyEvent.fire();
				docReadyEvent.clearListeners();
			}else{
				if(!docReadyEvent)initDocReady();
				options=options||{};
				options.delay=options.delay||1;
				docReadyEvent.addListener(fn,scope,options);
			}
		},
		elHash:elHash
	};
	pub.on=pub.addListener;
	pub.un=pub.removeListener;
	pub.stoppedMouseDownEvent=new Ext.util.Event();
	return pub;}();
Ext.onReady=Ext.EventManager.onDocumentReady;
(function(){
	var initExtCss=function(){
		var bd=document.body||document.getElementsByTagName('body')[0];
		if(!bd){return false;}
		var cls=[' ',
				Ext.isIE?"ext-ie "+(Ext.isIE6?'ext-ie6':(Ext.isIE7?'ext-ie7':'ext-ie8'))
				:Ext.isGecko?"ext-gecko "+(Ext.isGecko2?'ext-gecko2':'ext-gecko3')
				:Ext.isOpera?"ext-opera"
				:Ext.isWebKit?"ext-webkit":""];
		if(Ext.isSafari){
			cls.push("ext-safari "+(Ext.isSafari2?'ext-safari2':(Ext.isSafari3?'ext-safari3':'ext-safari4')));
		}else if(Ext.isChrome){
			cls.push("ext-chrome");
		}
		if(Ext.isMac){
			cls.push("ext-mac");
		}
		if(Ext.isLinux){
			cls.push("ext-linux");
		}
		if(Ext.isStrict||Ext.isBorderBox){
			var p=bd.parentNode;
			if(p){
				p.className+=Ext.isStrict?' ext-strict':' ext-border-box';
			}
		}
		bd.className+=cls.join(' ');
		return true;
	}
	if(!initExtCss()){
		Ext.onReady(initExtCss);
	}})();
Ext.EventObject=function(){
	var E=Ext.lib.Event,
		safariKeys={
			3:13,
			63234:37,
			63235:39,
			63232:38,
			63233:40,
			63276:33,
			63277:34,
			63272:46,
			63273:36,
			63275:35
		},
		btnMap=Ext.isIE?{1:0,4:1,2:2}:
				(Ext.isWebKit?{1:0,2:1,3:2}:{0:0,1:1,2:2});
	Ext.EventObjectImpl=function(e){
		if(e){
			this.setEvent(e.browserEvent||e);
		}
	};
	Ext.EventObjectImpl.prototype={
		setEvent:function(e){
			var me=this;
			if(e==me||(e&&e.browserEvent)){
				return e;
			}
			me.browserEvent=e;
			if(e){
				me.button=e.button?btnMap[e.button]:(e.which?e.which-1:-1);
				if(e.type=='click'&&me.button==-1){
					me.button=0;
				}
				me.type=e.type;
				me.shiftKey=e.shiftKey;
				me.ctrlKey=e.ctrlKey||e.metaKey||false;
				me.altKey=e.altKey;
				me.keyCode=e.keyCode;
				me.charCode=e.charCode;
				me.target=E.getTarget(e);
				me.xy=E.getXY(e);
			}else{
				me.button=-1;
				me.shiftKey=false;
				me.ctrlKey=false;
				me.altKey=false;
				me.keyCode=0;
				me.charCode=0;
				me.target=null;
				me.xy=[0,0];
			}
			return me;
		},
		stopEvent:function(){
			var me=this;
			if(me.browserEvent){
				if(me.browserEvent.type=='mousedown'){
					Ext.EventManager.stoppedMouseDownEvent.fire(me);
				}
				E.stopEvent(me.browserEvent);
			}
		},
		preventDefault:function(){
			if(this.browserEvent){
				E.preventDefault(this.browserEvent);
			}
		},
		stopPropagation:function(){
			var me=this;
			if(me.browserEvent){
				if(me.browserEvent.type=='mousedown'){
					Ext.EventManager.stoppedMouseDownEvent.fire(me);
				}
				E.stopPropagation(me.browserEvent);
			}
		},
		getCharCode:function(){
			return this.charCode||this.keyCode;
		},
		getKey:function(){
			return this.normalizeKey(this.keyCode||this.charCode)
		},
		normalizeKey:function(k){
			return Ext.isSafari?(safariKeys[k]||k):k;
		},
		getPageX:function(){
			return this.xy[0];
		},
		getPageY:function(){
			return this.xy[1];
		},
		getXY:function(){
			return this.xy;
		},
		getTarget:function(selector,maxDepth,returnEl){
			return selector?Ext.fly(this.target).findParent(selector,maxDepth,returnEl):(returnEl?Ext.get(this.target):this.target);
		},
		getRelatedTarget:function(){
			return this.browserEvent?E.getRelatedTarget(this.browserEvent):null;
		},
		getWheelDelta:function(){
			var e=this.browserEvent;
			var delta=0;
			if(e.wheelDelta){
				delta=e.wheelDelta/120;
			}else if(e.detail){
				delta=-e.detail/3;
			}
			return delta;
		},
		within:function(el,related,allowEl){
			if(el){
				var t=this[related?"getRelatedTarget":"getTarget"]();
				return t&&((allowEl?(t==Ext.getDom(el)):false)||Ext.fly(el).contains(t));
			}
			return false;
		}
	};
	return new Ext.EventObjectImpl();}();
Ext.apply(Ext.EventManager,function(){
	var resizeEvent,
		resizeTask,
		textEvent,
		textSize,
		D=Ext.lib.Dom,
		E=Ext.lib.Event,
		propRe=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,
		curWidth=0,
		curHeight=0,
		useKeydown=Ext.isSafari?
					Ext.num(navigator.userAgent.toLowerCase().match(/version\/(\d+\.\d)/)[1]||2)>=3.1:
					!((Ext.isGecko&&!Ext.isWindows)||Ext.isOpera);
	return{
		doResizeEvent:function(){
			var h=D.getViewHeight(),
				w=D.getViewWidth();
			if(curHeight!=h||curWidth!=w){
				resizeEvent.fire(curWidth=w,curHeight=h);
			}
		},
		onWindowResize:function(fn,scope,options){
			if(!resizeEvent){
				resizeEvent=new Ext.util.Event();
				resizeTask=new Ext.util.DelayedTask(this.doResizeEvent);
				E.on(window,"resize",this.fireWindowResize,this);
			}
			resizeEvent.addListener(fn,scope,options);
		},
		fireWindowResize:function(){
			if(resizeEvent){
				if((Ext.isIE||Ext.isAir)&&resizeTask){
					resizeTask.delay(50);
				}else{
					resizeEvent.fire(D.getViewWidth(),D.getViewHeight());
				}
			}
		},
		onTextResize:function(fn,scope,options){
			if(!textEvent){
				textEvent=new Ext.util.Event();
				var textEl=new Ext.Element(document.createElement('div'));
				textEl.dom.className='x-text-resize';
				textEl.dom.innerHTML='X';
				textEl.appendTo(document.body);
				textSize=textEl.dom.offsetHeight;
				setInterval(function(){
					if(textEl.dom.offsetHeight!=textSize){
						textEvent.fire(textSize,textSize=textEl.dom.offsetHeight);
					}
				},this.textResizeInterval);
			}
			textEvent.addListener(fn,scope,options);
		},
		removeResizeListener:function(fn,scope){
			if(resizeEvent){
				resizeEvent.removeListener(fn,scope);
			}
		},
		fireResize:function(){
			if(resizeEvent){
				resizeEvent.fire(D.getViewWidth(),D.getViewHeight());
			}
		},
		textResizeInterval:50,
		ieDeferSrc:false,
		useKeydown:useKeydown
	};}());
Ext.EventManager.on=Ext.EventManager.addListener;
Ext.apply(Ext.EventObjectImpl.prototype,{
	BACKSPACE:8,
	TAB:9,
	NUM_CENTER:12,
	ENTER:13,
	RETURN:13,
	SHIFT:16,
	CTRL:17,
	CONTROL:17,
	ALT:18,
	PAUSE:19,
	CAPS_LOCK:20,
	ESC:27,
	SPACE:32,
	PAGE_UP:33,
	PAGEUP:33,
	PAGE_DOWN:34,
	PAGEDOWN:34,
	END:35,
	HOME:36,
	LEFT:37,
	UP:38,
	RIGHT:39,
	DOWN:40,
	PRINT_SCREEN:44,
	INSERT:45,
	DELETE:46,
	ZERO:48,
	ONE:49,
	TWO:50,
	THREE:51,
	FOUR:52,
	FIVE:53,
	SIX:54,
	SEVEN:55,
	EIGHT:56,
	NINE:57,
	A:65,
	B:66,
	C:67,
	D:68,
	E:69,
	F:70,
	G:71,
	H:72,
	I:73,
	J:74,
	K:75,
	L:76,
	M:77,
	N:78,
	O:79,
	P:80,
	Q:81,
	R:82,
	S:83,
	T:84,
	U:85,
	V:86,
	W:87,
	X:88,
	Y:89,
	Z:90,
	CONTEXT_MENU:93,
	NUM_ZERO:96,
	NUM_ONE:97,
	NUM_TWO:98,
	NUM_THREE:99,
	NUM_FOUR:100,
	NUM_FIVE:101,
	NUM_SIX:102,
	NUM_SEVEN:103,
	NUM_EIGHT:104,
	NUM_NINE:105,
	NUM_MULTIPLY:106,
	NUM_PLUS:107,
	NUM_MINUS:109,
	NUM_PERIOD:110,
	NUM_DIVISION:111,
	F1:112,
	F2:113,
	F3:114,
	F4:115,
	F5:116,
	F6:117,
	F7:118,
	F8:119,
	F9:120,
	F10:121,
	F11:122,
	F12:123,
	isNavKeyPress:function(){
		var me=this,
			k=this.normalizeKey(me.keyCode);
		return(k>=33&&k<=40)||
		k==me.RETURN||
		k==me.TAB||
		k==me.ESC;
	},
	isSpecialKey:function(){
		var k=this.normalizeKey(this.keyCode);
		return(this.type=='keypress'&&this.ctrlKey)||
		this.isNavKeyPress()||
		(k==this.BACKSPACE)||
		(k>=16&&k<=20)||
		(k>=44&&k<=45);
	},
	getPoint:function(){
		return new Ext.lib.Point(this.xy[0],this.xy[1]);
	},
	hasModifier:function(){
		return((this.ctrlKey||this.altKey)||this.shiftKey);
	}});
(function(){
var DOC=document;
Ext.Element=function(element,forceNew){
	var dom=typeof element=="string"?
			 DOC.getElementById(element):element,
		id;
	if(!dom)return null;
	id=dom.id;
	if(!forceNew&&id&&Ext.Element.cache[id]){
		return Ext.Element.cache[id];
	}
	this.dom=dom;
	this.id=id||Ext.id(dom);};
var D=Ext.lib.Dom,
	DH=Ext.DomHelper,
	E=Ext.lib.Event,
	A=Ext.lib.Anim,
	El=Ext.Element;
El.prototype={
	set:function(o,useSet){
		var el=this.dom,
			attr,
			val;
		for(attr in o){
			val=o[attr];
			if(attr!="style"&&!Ext.isFunction(val)){
				if(attr=="cls"){
					el.className=val;
				}else if(o.hasOwnProperty(attr)){
					if(useSet||!!el.setAttribute)el.setAttribute(attr,val);
					else el[attr]=val;
				}
			}
		}
		if(o.style){
			Ext.DomHelper.applyStyles(el,o.style);
		}
		return this;
	},
	defaultUnit:"px",
	is:function(simpleSelector){
		return Ext.DomQuery.is(this.dom,simpleSelector);
	},
	focus:function(defer,dom){
		var me=this,
			dom=dom||me.dom;
		try{
			if(Number(defer)){
				me.focus.defer(defer,null,[null,dom]);
			}else{
				dom.focus();
			}
		}catch(e){}
		return me;
	},
	blur:function(){
		try{
			this.dom.blur();
		}catch(e){}
		return this;
	},
	getValue:function(asNumber){
		var val=this.dom.value;
		return asNumber?parseInt(val,10):val;
	},
	addListener:function(eventName,fn,scope,options){
		Ext.EventManager.on(this.dom,eventName,fn,scope||this,options);
		return this;
	},
	removeListener:function(eventName,fn,scope){
		Ext.EventManager.removeListener(this.dom,eventName,fn,scope||this);
		return this;
	},
	removeAllListeners:function(){
		Ext.EventManager.removeAll(this.dom);
		return this;
	},
	addUnits:function(size){
		if(size===""||size=="auto"||size===undefined){
			size=size||'';
		}else if(!isNaN(size)||!unitPattern.test(size)){
			size=size+(this.defaultUnit||'px');
		}
		return size;
	},
	load:function(url,params,cb){
		Ext.Ajax.request(Ext.apply({
			params:params,
			url:url.url||url,
			callback:cb,
			el:this.dom,
			indicatorText:url.indicatorText||''
		},Ext.isObject(url)?url:{}));
		return this;
	},
	isBorderBox:function(){
		return noBoxAdjust[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox;
	},
	remove:function(){
		var me=this,
			dom=me.dom;
		me.removeAllListeners();
		delete El.cache[dom.id];
		delete El.dataCache[dom.id]
		Ext.removeNode(dom);
	},
	hover:function(overFn,outFn,scope,options){
		var me=this;
		me.on('mouseenter',overFn,scope||me.dom,options);
		me.on('mouseleave',outFn,scope||me.dom,options);
		return me;
	},
	contains:function(el){
		return!el?false:Ext.lib.Dom.isAncestor(this.dom,el.dom?el.dom:el);
	},
	getAttributeNS:function(ns,name){
		return this.getAttribute(name,ns);
	},
	getAttribute:Ext.isIE?function(name,ns){
		var d=this.dom,
			type=typeof d[ns+":"+name];
		if(['undefined','unknown'].indexOf(type)==-1){
			return d[ns+":"+name];
		}
		return d[name];
	}:function(name,ns){
		var d=this.dom;
		return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name];
	},
	update:function(html){
		this.dom.innerHTML=html;
		return this;
	}};
var ep=El.prototype;
El.addMethods=function(o){
Ext.apply(ep,o);};
ep.on=ep.addListener;
ep.un=ep.removeListener;
ep.autoBoxAdjust=true;
var unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,
	docEl;
El.cache={};
El.dataCache={};
El.get=function(el){
	var ex,
		elm,
		id;
	if(!el){return null;}
	if(typeof el=="string"){
		if(!(elm=DOC.getElementById(el))){
			return null;
		}
		if(ex=El.cache[el]){
			ex.dom=elm;
		}else{
			ex=El.cache[el]=new El(elm);
		}
		return ex;
	}else if(el.tagName){
		if(!(id=el.id)){
			id=Ext.id(el);
		}
		if(ex=El.cache[id]){
			ex.dom=el;
		}else{
			ex=El.cache[id]=new El(el);
		}
		return ex;
	}else if(el instanceof El){
		if(el!=docEl){
			el.dom=DOC.getElementById(el.id)||el.dom;
			El.cache[el.id]=el;
		}
		return el;
	}else if(el.isComposite){
		return el;
	}else if(Ext.isArray(el)){
		return El.select(el);
	}else if(el==DOC){
		if(!docEl){
			var f=function(){};
			f.prototype=El.prototype;
			docEl=new f();
			docEl.dom=DOC;
		}
		return docEl;
	}
	return null;};
El.data=function(el,key,value){
	var c=El.dataCache[el.id];
	if(!c){
		c=El.dataCache[el.id]={};
	}
	if(arguments.length==2){
		return c[key];
	}else{
		c[key]=value;
	}};
function garbageCollect(){
	if(!Ext.enableGarbageCollector){
		clearInterval(El.collectorThread);
	}else{
		var eid,
			el,
			d;
		for(eid in El.cache){
			el=El.cache[eid];
			d=el.dom;
			if(!d||!d.parentNode||(!d.offsetParent&&!DOC.getElementById(eid))){
				delete El.cache[eid];
				if(d&&Ext.enableListenerCollection){
					Ext.EventManager.removeAll(d);
				}
			}
		}
	}}
El.collectorThreadId=setInterval(garbageCollect,30000);
var flyFn=function(){};
flyFn.prototype=El.prototype;
El.Flyweight=function(dom){
	this.dom=dom;};
El.Flyweight.prototype=new flyFn();
El.Flyweight.prototype.isFlyweight=true;
El._flyweights={};
El.fly=function(el,named){
	var ret=null;
	named=named||'_global';
	if(el=Ext.getDom(el)){
		(El._flyweights[named]=El._flyweights[named]||new El.Flyweight()).dom=el;
		ret=El._flyweights[named];
	}
	return ret;};
Ext.get=El.get;
Ext.fly=El.fly;
var noBoxAdjust=Ext.isStrict?{
	select:1}:{
	input:1,select:1,textarea:1};
if(Ext.isIE||Ext.isGecko){
	noBoxAdjust['button']=1;}
Ext.EventManager.on(window,'unload',function(){
	delete El.cache;
	delete El.dataCache;
	delete El._flyweights;});})();
Ext.Element.addMethods({
	swallowEvent:function(eventName,preventDefault){
		var me=this;
		function fn(e){
			e.stopPropagation();
			if(preventDefault){
				e.preventDefault();
			}
		}
		if(Ext.isArray(eventName)){
			Ext.each(eventName,function(e){
				 me.on(e,fn);
			});
			return me;
		}
		me.on(eventName,fn);
		return me;
	},
	relayEvent:function(eventName,observable){
		this.on(eventName,function(e){
			observable.fireEvent(eventName,e);
		});
	},
	clean:function(forceReclean){
		var me=this,
			dom=me.dom,
			n=dom.firstChild,
			ni=-1;
		if(Ext.Element.data(dom,'isCleaned')&&forceReclean!==true){
			return me;
		}
		while(n){
			var nx=n.nextSibling;
			if(n.nodeType==3&&!/\S/.test(n.nodeValue)){
				dom.removeChild(n);
			}else{
				n.nodeIndex=++ni;
			}
			n=nx;
		}
		Ext.Element.data(dom,'isCleaned',true);
		return me;
	},
	load:function(){
		var um=this.getUpdater();
		um.update.apply(um,arguments);
		return this;
	},
	getUpdater:function(){
		return this.updateManager||(this.updateManager=new Ext.Updater(this));
	},
	update:function(html,loadScripts,callback){
		html=html||"";
		if(loadScripts!==true){
			this.dom.innerHTML=html;
			if(Ext.isFunction(callback)){
				callback();
			}
			return this;
		}
		var id=Ext.id(),
			dom=this.dom;
		html+='<span id="'+id+'"></span>';
		Ext.lib.Event.onAvailable(id,function(){
			var DOC=document,
				hd=DOC.getElementsByTagName("head")[0],
				re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
				srcRe=/\ssrc=([\'\"])(.*?)\1/i,
				typeRe=/\stype=([\'\"])(.*?)\1/i,
				match,
				attrs,
				srcMatch,
				typeMatch,
				el,
				s;
			while((match=re.exec(html))){
				attrs=match[1];
				srcMatch=attrs?attrs.match(srcRe):false;
				if(srcMatch&&srcMatch[2]){
				 s=DOC.createElement("script");
				 s.src=srcMatch[2];
				 typeMatch=attrs.match(typeRe);
				 if(typeMatch&&typeMatch[2]){
					 s.type=typeMatch[2];
				}
				 hd.appendChild(s);
				}else if(match[2]&&match[2].length>0){
					if(window.execScript){
					 window.execScript(match[2]);
					}else{
					 window.eval(match[2]);
					}
				}
			}
			el=DOC.getElementById(id);
			if(el){Ext.removeNode(el);}
			if(Ext.isFunction(callback)){
				callback();
			}
		});
		dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");
		return this;
	},
	createProxy:function(config,renderTo,matchBox){
		config=Ext.isObject(config)?config:{tag:"div",cls:config};
		var me=this,
			proxy=renderTo?Ext.DomHelper.append(renderTo,config,true):
							 Ext.DomHelper.insertBefore(me.dom,config,true);
		if(matchBox&&me.setBox&&me.getBox){
		 proxy.setBox(me.getBox());
		}
		return proxy;
	}});
Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;
Ext.Element.uncache=function(el){
	for(var i=0,a=arguments,len=a.length;i<len;i++){
		if(a[i]){
			delete Ext.Element.cache[a[i].id||a[i]];
		}
	}};
Ext.Element.addMethods({
	getAnchorXY:function(anchor,local,s){
		anchor=(anchor||"tl").toLowerCase();
		s=s||{};
		var me=this,
			vp=me.dom==document.body||me.dom==document,
			w=s.width||vp?Ext.lib.Dom.getViewWidth():me.getWidth(),
			h=s.height||vp?Ext.lib.Dom.getViewHeight():me.getHeight(),
			xy,
			r=Math.round,
			o=me.getXY(),
			scroll=me.getScroll(),
			extraX=vp?scroll.left:!local?o[0]:0,
			extraY=vp?scroll.top:!local?o[1]:0,
			hash={
				c:[r(w*0.5),r(h*0.5)],
				t:[r(w*0.5),0],
				l:[0,r(h*0.5)],
				r:[w,r(h*0.5)],
				b:[r(w*0.5),h],
				tl:[0,0],
				bl:[0,h],
				br:[w,h],
				tr:[w,0]
			};
		xy=hash[anchor];
		return[xy[0]+extraX,xy[1]+extraY];
	},
	anchorTo:function(el,alignment,offsets,animate,monitorScroll,callback){
		var me=this,
			dom=me.dom;
		function action(){
			Ext.fly(dom).alignTo(el,alignment,offsets,animate);
			Ext.callback(callback,Ext.fly(dom));
		}
		Ext.EventManager.onWindowResize(action,me);
		if(!Ext.isEmpty(monitorScroll)){
			Ext.EventManager.on(window,'scroll',action,me,
				{buffer:!isNaN(monitorScroll)?monitorScroll:50});
		}
		action.call(me);
		return me;
	},
	getAlignToXY:function(el,p,o){
		el=Ext.get(el);
		if(!el||!el.dom){
			throw"Element.alignToXY with an element that doesn't exist";
		}
		o=o||[0,0];
		p=(p=="?"?"tl-bl?":(!/-/.test(p)&&p!==""?"tl-"+p:p||"tl-bl")).toLowerCase();
		var me=this,
			d=me.dom,
			a1,
			a2,
			x,
			y,
			w,
			h,
			r,
			dw=Ext.lib.Dom.getViewWidth()-10,
			dh=Ext.lib.Dom.getViewHeight()-10,
			p1y,
			p1x,
			p2y,
			p2x,
			swapY,
			swapX,
			doc=document,
			docElement=doc.documentElement,
			docBody=doc.body,
			scrollX=(docElement.scrollLeft||docBody.scrollLeft||0)+5,
			scrollY=(docElement.scrollTop||docBody.scrollTop||0)+5,
			c=false,
			p1="",
			p2="",
			m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
		if(!m){
		 throw"Element.alignTo with an invalid alignment "+p;
		}
		p1=m[1];
		p2=m[2];
		c=!!m[3];
		a1=me.getAnchorXY(p1,true);
		a2=el.getAnchorXY(p2,false);
		x=a2[0]-a1[0]+o[0];
		y=a2[1]-a1[1]+o[1];
		if(c){
		 w=me.getWidth();
		 h=me.getHeight();
		 r=el.getRegion();
		 p1y=p1.charAt(0);
		 p1x=p1.charAt(p1.length-1);
		 p2y=p2.charAt(0);
		 p2x=p2.charAt(p2.length-1);
		 swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));
		 swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));
		 if(x+w>dw+scrollX){
				x=swapX?r.left-w:dw+scrollX-w;
		}
		 if(x<scrollX){
			 x=swapX?r.right:scrollX;
		}
		 if(y+h>dh+scrollY){
				y=swapY?r.top-h:dh+scrollY-h;
			}
		 if(y<scrollY){
			 y=swapY?r.bottom:scrollY;
		}
		}
		return[x,y];
	},
	alignTo:function(element,position,offsets,animate){
		var me=this;
		return me.setXY(me.getAlignToXY(element,position,offsets),
		 				me.preanim&&!!animate?me.preanim(arguments,3):false);
	},
	adjustForConstraints:function(xy,parent,offsets){
		return this.getConstrainToXY(parent||document,false,offsets,xy)||xy;
	},
	getConstrainToXY:function(el,local,offsets,proposedXY){
		var os={top:0,left:0,bottom:0,right:0};
		return function(el,local,offsets,proposedXY){
			el=Ext.get(el);
			offsets=offsets?Ext.applyIf(offsets,os):os;
			var vw,vh,vx=0,vy=0;
			if(el.dom==document.body||el.dom==document){
				vw=Ext.lib.Dom.getViewWidth();
				vh=Ext.lib.Dom.getViewHeight();
			}else{
				vw=el.dom.clientWidth;
				vh=el.dom.clientHeight;
				if(!local){
					var vxy=el.getXY();
					vx=vxy[0];
					vy=vxy[1];
				}
			}
			var s=el.getScroll();
			vx+=offsets.left+s.left;
			vy+=offsets.top+s.top;
			vw-=offsets.right;
			vh-=offsets.bottom;
			var vr=vx+vw;
			var vb=vy+vh;
			var xy=proposedXY||(!local?this.getXY():[this.getLeft(true),this.getTop(true)]);
			var x=xy[0],y=xy[1];
			var w=this.dom.offsetWidth,h=this.dom.offsetHeight;
			var moved=false;
			if((x+w)>vr){
				x=vr-w;
				moved=true;
			}
			if((y+h)>vb){
				y=vb-h;
				moved=true;
			}
			if(x<vx){
				x=vx;
				moved=true;
			}
			if(y<vy){
				y=vy;
				moved=true;
			}
			return moved?[x,y]:false;
		};
	}(),
	getCenterXY:function(){
		return this.getAlignToXY(document,'c-c');
	},
	center:function(centerIn){
		return this.alignTo(centerIn||document,'c-c');
	}});
Ext.Element.addMethods(function(){
	var PARENTNODE='parentNode',
		NEXTSIBLING='nextSibling',
		PREVIOUSSIBLING='previousSibling',
		DQ=Ext.DomQuery,
		GET=Ext.get;
	return{
		findParent:function(simpleSelector,maxDepth,returnEl){
			var p=this.dom,
				b=document.body,
				depth=0,
				stopEl;
			if(Ext.isGecko&&Object.prototype.toString.call(p)=='[object XULElement]'){
				return null;
			}
			maxDepth=maxDepth||50;
			if(isNaN(maxDepth)){
				stopEl=Ext.getDom(maxDepth);
				maxDepth=Number.MAX_VALUE;
			}
			while(p&&p.nodeType==1&&depth<maxDepth&&p!=b&&p!=stopEl){
				if(DQ.is(p,simpleSelector)){
					return returnEl?GET(p):p;
				}
				depth++;
				p=p.parentNode;
			}
			return null;
		},
		findParentNode:function(simpleSelector,maxDepth,returnEl){
			var p=Ext.fly(this.dom.parentNode,'_internal');
			return p?p.findParent(simpleSelector,maxDepth,returnEl):null;
		},
		up:function(simpleSelector,maxDepth){
			return this.findParentNode(simpleSelector,maxDepth,true);
		},
		select:function(selector,unique){
			return Ext.Element.select(selector,unique,this.dom);
		},
		query:function(selector,unique){
			return DQ.select(selector,this.dom);
		},
		child:function(selector,returnDom){
			var n=DQ.selectNode(selector,this.dom);
			return returnDom?n:GET(n);
		},
		down:function(selector,returnDom){
			var n=DQ.selectNode(" > "+selector,this.dom);
			return returnDom?n:GET(n);
		},
		parent:function(selector,returnDom){
			return this.matchNode(PARENTNODE,PARENTNODE,selector,returnDom);
		},
		next:function(selector,returnDom){
			return this.matchNode(NEXTSIBLING,NEXTSIBLING,selector,returnDom);
		},
		prev:function(selector,returnDom){
			return this.matchNode(PREVIOUSSIBLING,PREVIOUSSIBLING,selector,returnDom);
		},
		first:function(selector,returnDom){
			return this.matchNode(NEXTSIBLING,'firstChild',selector,returnDom);
		},
		last:function(selector,returnDom){
			return this.matchNode(PREVIOUSSIBLING,'lastChild',selector,returnDom);
		},
		matchNode:function(dir,start,selector,returnDom){
			var n=this.dom[start];
			while(n){
				if(n.nodeType==1&&(!selector||DQ.is(n,selector))){
					return!returnDom?GET(n):n;
				}
				n=n[dir];
			}
			return null;
		}
	}}());
Ext.Element.addMethods(
function(){
	var GETDOM=Ext.getDom,
		GET=Ext.get,
		DH=Ext.DomHelper,
		isEl=function(el){
			return(el.nodeType||el.dom||typeof el=='string');
		};
	return{
		appendChild:function(el){
			return GET(el).appendTo(this);
		},
		appendTo:function(el){
			GETDOM(el).appendChild(this.dom);
			return this;
		},
		insertBefore:function(el){
			(el=GETDOM(el)).parentNode.insertBefore(this.dom,el);
			return this;
		},
		insertAfter:function(el){
			(el=GETDOM(el)).parentNode.insertBefore(this.dom,el.nextSibling);
			return this;
		},
		insertFirst:function(el,returnDom){
			el=el||{};
			if(isEl(el)){
				el=GETDOM(el);
				this.dom.insertBefore(el,this.dom.firstChild);
				return!returnDom?GET(el):el;
			}else{
				return this.createChild(el,this.dom.firstChild,returnDom);
			}
	},
		replace:function(el){
			el=GET(el);
			this.insertBefore(el);
			el.remove();
			return this;
		},
		replaceWith:function(el){
			var me=this,
				Element=Ext.Element;
			if(isEl(el)){
				el=GETDOM(el);
				me.dom.parentNode.insertBefore(el,me.dom);
			}else{
				el=DH.insertBefore(me.dom,el);
			}
			delete Element.cache[me.id];
			Ext.removeNode(me.dom);
			me.id=Ext.id(me.dom=el);
			return Element.cache[me.id]=me;
		},
		createChild:function(config,insertBefore,returnDom){
			config=config||{tag:'div'};
			return insertBefore?
				 DH.insertBefore(insertBefore,config,returnDom!==true):
				 DH[!this.dom.firstChild?'overwrite':'append'](this.dom,config,returnDom!==true);
		},
		wrap:function(config,returnDom){
			var newEl=DH.insertBefore(this.dom,config||{tag:"div"},!returnDom);
			newEl.dom?newEl.dom.appendChild(this.dom):newEl.appendChild(this.dom);
			return newEl;
		},
		insertHtml:function(where,html,returnEl){
			var el=DH.insertHtml(where,this.dom,html);
			return returnEl?Ext.get(el):el;
		}
	}}());
Ext.apply(Ext.Element.prototype,function(){
	var GETDOM=Ext.getDom,
		GET=Ext.get,
		DH=Ext.DomHelper;
	return{
		insertSibling:function(el,where,returnDom){
			var me=this,
				rt;
			if(Ext.isArray(el)){
				Ext.each(el,function(e){
					rt=me.insertSibling(e,where,returnDom);
				});
				return rt;
			}
			where=(where||'before').toLowerCase();
			el=el||{};
			if(el.nodeType||el.dom){
				rt=me.dom.parentNode.insertBefore(GETDOM(el),where=='before'?me.dom:me.dom.nextSibling);
				if(!returnDom){
					rt=GET(rt);
				}
			}else{
				if(where=='after'&&!me.dom.nextSibling){
					rt=DH.append(me.dom.parentNode,el,!returnDom);
				}else{
					rt=DH[where=='after'?'insertAfter':'insertBefore'](me.dom,el,!returnDom);
				}
			}
			return rt;
		}
	};}());
Ext.Element.addMethods(function(){
	var propCache={},
		camelRe=/(-[a-z])/gi,
		classReCache={},
		view=document.defaultView,
		propFloat=Ext.isIE?'styleFloat':'cssFloat',
		opacityRe=/alpha\(opacity=(.*)\)/i,
		trimRe=/^\s+|\s+$/g,
		EL=Ext.Element,
		PADDING="padding",
		MARGIN="margin",
		BORDER="border",
		LEFT="-left",
		RIGHT="-right",
		TOP="-top",
		BOTTOM="-bottom",
		WIDTH="-width",
		MATH=Math,
		HIDDEN='hidden',
		ISCLIPPED='isClipped',
		OVERFLOW='overflow',
		OVERFLOWX='overflow-x',
		OVERFLOWY='overflow-y',
		ORIGINALCLIP='originalClip',
		borders={l:BORDER+LEFT+WIDTH,r:BORDER+RIGHT+WIDTH,t:BORDER+TOP+WIDTH,b:BORDER+BOTTOM+WIDTH},
		paddings={l:PADDING+LEFT,r:PADDING+RIGHT,t:PADDING+TOP,b:PADDING+BOTTOM},
		margins={l:MARGIN+LEFT,r:MARGIN+RIGHT,t:MARGIN+TOP,b:MARGIN+BOTTOM},
		data=Ext.Element.data;
	function camelFn(m,a){
		return a.charAt(1).toUpperCase();
	}
	function addStyles(sides,styles){
		var val=0;
		Ext.each(sides.match(/\w/g),function(s){
			if(s=parseInt(this.getStyle(styles[s]),10)){
				val+=MATH.abs(s);
			}
		},
		this);
		return val;
	}
	function chkCache(prop){
		return propCache[prop]||(propCache[prop]=prop=='float'?propFloat:prop.replace(camelRe,camelFn));
	}
	return{
		adjustWidth:function(width){
			var me=this;
			var isNum=(typeof width=="number");
			if(isNum&&me.autoBoxAdjust&&!me.isBorderBox()){
			 width-=(me.getBorderWidth("lr")+me.getPadding("lr"));
			}
			return(isNum&&width<0)?0:width;
		},
		adjustHeight:function(height){
			var me=this;
			var isNum=(typeof height=="number");
			if(isNum&&me.autoBoxAdjust&&!me.isBorderBox()){
			 height-=(me.getBorderWidth("tb")+me.getPadding("tb"));
			}
			return(isNum&&height<0)?0:height;
		},
		addClass:function(className){
			var me=this;
			Ext.each(className,function(v){
				me.dom.className+=(!me.hasClass(v)&&v?" "+v:"");
			});
			return me;
		},
		radioClass:function(className){
			Ext.each(this.dom.parentNode.childNodes,function(v){
				if(v.nodeType==1){
					Ext.fly(v,'_internal').removeClass(className);
				}
			});
			return this.addClass(className);
		},
		removeClass:function(className){
			var me=this;
			if(me.dom.className){
				Ext.each(className,function(v){
					me.dom.className=me.dom.className.replace(
						classReCache[v]=classReCache[v]||new RegExp('(?:^|\\s+)'+v+'(?:\\s+|$)',"g"),
						" ");
				});
			}
			return me;
		},
		toggleClass:function(className){
			return this.hasClass(className)?this.removeClass(className):this.addClass(className);
		},
		hasClass:function(className){
			return className&&(' '+this.dom.className+' ').indexOf(' '+className+' ')!=-1;
		},
		replaceClass:function(oldClassName,newClassName){
			return this.removeClass(oldClassName).addClass(newClassName);
		},
		isStyle:function(style,val){
			return this.getStyle(style)==val;
		},
		getStyle:function(){
			return view&&view.getComputedStyle?
				function(prop){
					var el=this.dom,
						v,
						cs;
					if(el==document)return null;
					prop=chkCache(prop);
					return(v=el.style[prop])?v:
						(cs=view.getComputedStyle(el,""))?cs[prop]:null;
				}:
				function(prop){
					var el=this.dom,
						m,
						cs;
					if(el==document)return null;
					if(prop=='opacity'){
						if(el.style.filter.match){
							if(m=el.style.filter.match(opacityRe)){
								var fv=parseFloat(m[1]);
								if(!isNaN(fv)){
									return fv?fv/100:0;
								}
							}
						}
						return 1;
					}
					prop=chkCache(prop);
					return el.style[prop]||((cs=el.currentStyle)?cs[prop]:null);
				};
		}(),
		getColor:function(attr,defaultValue,prefix){
			var v=this.getStyle(attr),
				color=prefix||'#',
				h;
			if(!v||/transparent|inherit/.test(v)){
				return defaultValue;
			}
			if(/^r/.test(v)){
				Ext.each(v.slice(4,v.length-1).split(','),function(s){
					h=parseInt(s,10);
					color+=(h<16?'0':'')+h.toString(16);
				});
			}else{
				v=v.replace('#','');
				color+=v.length==3?v.replace(/^(\w)(\w)(\w)$/,'$1$1$2$2$3$3'):v;
			}
			return(color.length>5?color.toLowerCase():defaultValue);
		},
		setStyle:function(prop,value){
			var tmp,
				style,
				camel;
			if(!Ext.isObject(prop)){
				tmp={};
				tmp[prop]=value;
				prop=tmp;
			}
			for(style in prop){
				value=prop[style];
				style=='opacity'?
					this.setOpacity(value):
					this.dom.style[chkCache(style)]=value;
			}
			return this;
		},
		 setOpacity:function(opacity,animate){
			var me=this,
				s=me.dom.style;
			if(!animate||!me.anim){
				if(Ext.isIE){
					var opac=opacity<1?'alpha(opacity='+opacity*100+')':'',
					val=s.filter.replace(opacityRe,'').replace(trimRe,'');
					s.zoom=1;
					s.filter=val+(val.length>0?' ':'')+opac;
				}else{
					s.opacity=opacity;
				}
			}else{
				me.anim({opacity:{to:opacity}},me.preanim(arguments,1),null,.35,'easeIn');
			}
			return me;
		},
		clearOpacity:function(){
			var style=this.dom.style;
			if(Ext.isIE){
				if(!Ext.isEmpty(style.filter)){
					style.filter=style.filter.replace(opacityRe,'').replace(trimRe,'');
				}
			}else{
				style.opacity=style['-moz-opacity']=style['-khtml-opacity']='';
			}
			return this;
		},
		getHeight:function(contentHeight){
			var me=this,
				dom=me.dom,
				h=MATH.max(dom.offsetHeight,dom.clientHeight)||0;
			h=!contentHeight?h:h-me.getBorderWidth("tb")-me.getPadding("tb");
			return h<0?0:h;
		},
		getWidth:function(contentWidth){
			var me=this,
				dom=me.dom,
				w=MATH.max(dom.offsetWidth,dom.clientWidth)||0;
			w=!contentWidth?w:w-me.getBorderWidth("lr")-me.getPadding("lr");
			return w<0?0:w;
		},
		setWidth:function(width,animate){
			var me=this;
			width=me.adjustWidth(width);
			!animate||!me.anim?
				me.dom.style.width=me.addUnits(width):
				me.anim({width:{to:width}},me.preanim(arguments,1));
			return me;
		},
		 setHeight:function(height,animate){
			var me=this;
			height=me.adjustHeight(height);
			!animate||!me.anim?
				me.dom.style.height=me.addUnits(height):
				me.anim({height:{to:height}},me.preanim(arguments,1));
			return me;
		},
		getBorderWidth:function(side){
			return addStyles.call(this,side,borders);
		},
		getPadding:function(side){
			return addStyles.call(this,side,paddings);
		},
		clip:function(){
			var me=this,
				dom=me.dom;
			if(!data(dom,ISCLIPPED)){
				data(dom,ISCLIPPED,true);
				data(dom,ORIGINALCLIP,{
					o:me.getStyle(OVERFLOW),
					x:me.getStyle(OVERFLOWX),
					y:me.getStyle(OVERFLOWY)
				});
				me.setStyle(OVERFLOW,HIDDEN);
				me.setStyle(OVERFLOWX,HIDDEN);
				me.setStyle(OVERFLOWY,HIDDEN);
			}
			return me;
		},
		unclip:function(){
			var me=this,
				dom=me.dom;
			if(data(dom,ISCLIPPED)){
				data(dom,ISCLIPPED,false);
				var o=data(dom,ORIGINALCLIP);
				if(o.o){
					me.setStyle(OVERFLOW,o.o);
				}
				if(o.x){
					me.setStyle(OVERFLOWX,o.x);
				}
				if(o.y){
					me.setStyle(OVERFLOWY,o.y);
				}
			}
			return me;
		},
		addStyles:addStyles,
		margins:margins
	}}());
Ext.Element.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
Ext.Element.addMethods(function(){
	var INTERNAL="_internal";
	return{
		applyStyles:function(style){
			Ext.DomHelper.applyStyles(this.dom,style);
			return this;
		},
		getStyles:function(){
			var ret={};
			Ext.each(arguments,function(v){
			 ret[v]=this.getStyle(v);
			},
			this);
			return ret;
		},
		getStyleSize:function(){
			var me=this,
				w,
				h,
				d=this.dom,
				s=d.style;
			if(s.width&&s.width!='auto'){
				w=parseInt(s.width,10);
				if(me.isBorderBox()){
				 w-=me.getFrameWidth('lr');
				}
			}
			if(s.height&&s.height!='auto'){
				h=parseInt(s.height,10);
				if(me.isBorderBox()){
				 h-=me.getFrameWidth('tb');
				}
			}
			return{width:w||me.getWidth(true),height:h||me.getHeight(true)};
		},
		setOverflow:function(v){
			var dom=this.dom;
			if(v=='auto'&&Ext.isMac&&Ext.isGecko2){
				dom.style.overflow='hidden';
				(function(){dom.style.overflow='auto';}).defer(1);
			}else{
				dom.style.overflow=v;
			}
		},
		boxWrap:function(cls){
			cls=cls||'x-box';
			var el=Ext.get(this.insertHtml("beforeBegin","<div class='"+cls+"'>"+String.format(Ext.Element.boxMarkup,cls)+"</div>"));
			Ext.DomQuery.selectNode('.'+cls+'-mc',el.dom).appendChild(this.dom);
			return el;
		},
		setSize:function(width,height,animate){
			var me=this;
			if(Ext.isObject(width)){
				height=width.height;
				width=width.width;
			}
			width=me.adjustWidth(width);
			height=me.adjustHeight(height);
			if(!animate||!me.anim){
				me.dom.style.width=me.addUnits(width);
				me.dom.style.height=me.addUnits(height);
			}else{
				me.anim({width:{to:width},height:{to:height}},me.preanim(arguments,2));
			}
			return me;
		},
		getComputedHeight:function(){
			var me=this,
				h=Math.max(me.dom.offsetHeight,me.dom.clientHeight);
			if(!h){
				h=parseInt(me.getStyle('height'),10)||0;
				if(!me.isBorderBox()){
					h+=me.getFrameWidth('tb');
				}
			}
			return h;
		},
		getComputedWidth:function(){
			var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);
			if(!w){
				w=parseInt(this.getStyle('width'),10)||0;
				if(!this.isBorderBox()){
					w+=this.getFrameWidth('lr');
				}
			}
			return w;
		},
		getFrameWidth:function(sides,onlyContentBox){
			return onlyContentBox&&this.isBorderBox()?0:(this.getPadding(sides)+this.getBorderWidth(sides));
		},
		addClassOnOver:function(className){
			this.hover(
				function(){
					Ext.fly(this,INTERNAL).addClass(className);
				},
				function(){
					Ext.fly(this,INTERNAL).removeClass(className);
				}
			);
			return this;
		},
		addClassOnFocus:function(className){
			this.on("focus",function(){
				Ext.fly(this,INTERNAL).addClass(className);
			},this.dom);
			this.on("blur",function(){
				Ext.fly(this,INTERNAL).removeClass(className);
			},this.dom);
			return this;
		},
		addClassOnClick:function(className){
			var dom=this.dom;
			this.on("mousedown",function(){
				Ext.fly(dom,INTERNAL).addClass(className);
				var d=Ext.getDoc(),
					fn=function(){
						Ext.fly(dom,INTERNAL).removeClass(className);
						d.removeListener("mouseup",fn);
					};
				d.on("mouseup",fn);
			});
			return this;
		},
		getViewSize:function(){
			var doc=document,
				d=this.dom,
				extdom=Ext.lib.Dom,
				isDoc=(d==doc||d==doc.body);
			return{width:(isDoc?extdom.getViewWidth():d.clientWidth),
					 height:(isDoc?extdom.getViewHeight():d.clientHeight)};
		},
		getSize:function(contentSize){
			return{width:this.getWidth(contentSize),height:this.getHeight(contentSize)};
		},
		repaint:function(){
			var dom=this.dom;
			this.addClass("x-repaint");
			setTimeout(function(){
				Ext.fly(dom).removeClass("x-repaint");
			},1);
			return this;
		},
		unselectable:function(){
			this.dom.unselectable="on";
			return this.swallowEvent("selectstart",true).
						applyStyles("-moz-user-select:none;-khtml-user-select:none;").
						addClass("x-unselectable");
		},
		getMargins:function(side){
			var me=this,
				key,
				hash={t:"top",l:"left",r:"right",b:"bottom"},
				o={};
			if(!side){
				for(key in me.margins){
					o[hash[key]]=parseInt(me.getStyle(me.margins[key]),10)||0;
				}
				return o;
			}else{
				return me.addStyles.call(me,side,me.margins);
			}
		}
	};}());
(function(){
var D=Ext.lib.Dom,
		LEFT="left",
		RIGHT="right",
		TOP="top",
		BOTTOM="bottom",
		POSITION="position",
		STATIC="static",
		RELATIVE="relative",
		AUTO="auto",
		ZINDEX="z-index";
function animTest(args,animate,i){
	return this.preanim&&!!animate?this.preanim(args,i):false}
Ext.Element.addMethods({
	getX:function(){
		return D.getX(this.dom);
	},
	getY:function(){
		return D.getY(this.dom);
	},
	getXY:function(){
		return D.getXY(this.dom);
	},
	getOffsetsTo:function(el){
		var o=this.getXY(),
			e=Ext.fly(el,'_internal').getXY();
		return[o[0]-e[0],o[1]-e[1]];
	},
	setX:function(x,animate){
		return this.setXY([x,this.getY()],animTest.call(this,arguments,animate,1));
	},
	setY:function(y,animate){
		return this.setXY([this.getX(),y],animTest.call(this,arguments,animate,1));
	},
	setLeft:function(left){
		this.setStyle(LEFT,this.addUnits(left));
		return this;
	},
	setTop:function(top){
		this.setStyle(TOP,this.addUnits(top));
		return this;
	},
	setRight:function(right){
		this.setStyle(RIGHT,this.addUnits(right));
		return this;
	},
	setBottom:function(bottom){
		this.setStyle(BOTTOM,this.addUnits(bottom));
		return this;
	},
	setXY:function(pos,animate){
		var me=this;
		if(!animate||!me.anim){
			D.setXY(me.dom,pos);
		}else{
			me.anim({points:{to:pos}},me.preanim(arguments,1),'motion');
		}
		return me;
	},
	setLocation:function(x,y,animate){
		return this.setXY([x,y],animTest.call(this,arguments,animate,2));
	},
	moveTo:function(x,y,animate){
		return this.setXY([x,y],animTest.call(this,arguments,animate,2));
	},
	getLeft:function(local){
		return!local?this.getX():parseInt(this.getStyle(LEFT),10)||0;
	},
	getRight:function(local){
		var me=this;
		return!local?me.getX()+me.getWidth():(me.getLeft(true)+me.getWidth())||0;
	},
	getTop:function(local){
		return!local?this.getY():parseInt(this.getStyle(TOP),10)||0;
	},
	getBottom:function(local){
		var me=this;
		return!local?me.getY()+me.getHeight():(me.getTop(true)+me.getHeight())||0;
	},
	position:function(pos,zIndex,x,y){
		var me=this;
		if(!pos&&me.isStyle(POSITION,STATIC)){
			me.setStyle(POSITION,RELATIVE);
		}else if(pos){
			me.setStyle(POSITION,pos);
		}
		if(zIndex){
			me.setStyle(ZINDEX,zIndex);
		}
		if(x||y)me.setXY([x||false,y||false]);
	},
	clearPositioning:function(value){
		value=value||'';
		this.setStyle({
			left:value,
			right:value,
			top:value,
			bottom:value,
			"z-index":"",
			position:STATIC
		});
		return this;
	},
	getPositioning:function(){
		var l=this.getStyle(LEFT);
		var t=this.getStyle(TOP);
		return{
			"position":this.getStyle(POSITION),
			"left":l,
			"right":l?"":this.getStyle(RIGHT),
			"top":t,
			"bottom":t?"":this.getStyle(BOTTOM),
			"z-index":this.getStyle(ZINDEX)
		};
	},
	setPositioning:function(pc){
		var me=this,
			style=me.dom.style;
		me.setStyle(pc);
		if(pc.right==AUTO){
			style.right="";
		}
		if(pc.bottom==AUTO){
			style.bottom="";
		}
		return me;
	},
	translatePoints:function(x,y){
		y=isNaN(x[1])?y:x[1];
		x=isNaN(x[0])?x:x[0];
		var me=this,
			relative=me.isStyle(POSITION,RELATIVE),
			o=me.getXY(),
			l=parseInt(me.getStyle(LEFT),10),
			t=parseInt(me.getStyle(TOP),10);
		l=!isNaN(l)?l:(relative?0:me.dom.offsetLeft);
		t=!isNaN(t)?t:(relative?0:me.dom.offsetTop);
		return{left:(x-o[0]+l),top:(y-o[1]+t)};
	},
	animTest:animTest});})();
Ext.Element.addMethods({
	setBox:function(box,adjust,animate){
		var me=this,
			w=box.width,
			h=box.height;
		if((adjust&&!me.autoBoxAdjust)&&!me.isBorderBox()){
		 w-=(me.getBorderWidth("lr")+me.getPadding("lr"));
		 h-=(me.getBorderWidth("tb")+me.getPadding("tb"));
		}
		me.setBounds(box.x,box.y,w,h,me.animTest.call(me,arguments,animate,2));
		return me;
	},
	getBox:function(contentBox,local){
		var me=this,
			xy,
			left,
			top,
			getBorderWidth=me.getBorderWidth,
			getPadding=me.getPadding,
			l,
			r,
			t,
			b;
		if(!local){
			xy=me.getXY();
		}else{
			left=parseInt(me.getStyle("left"),10)||0;
			top=parseInt(me.getStyle("top"),10)||0;
			xy=[left,top];
		}
		var el=me.dom,w=el.offsetWidth,h=el.offsetHeight,bx;
		if(!contentBox){
			bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h};
		}else{
			l=getBorderWidth.call(me,"l")+getPadding.call(me,"l");
			r=getBorderWidth.call(me,"r")+getPadding.call(me,"r");
			t=getBorderWidth.call(me,"t")+getPadding.call(me,"t");
			b=getBorderWidth.call(me,"b")+getPadding.call(me,"b");
			bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)};
		}
		bx.right=bx.x+bx.width;
		bx.bottom=bx.y+bx.height;
		return bx;
	},
	 move:function(direction,distance,animate){
		var me=this,
			xy=me.getXY(),
			x=xy[0],
			y=xy[1],
			left=[x-distance,y],
			right=[x+distance,y],
			top=[x,y-distance],
			bottom=[x,y+distance],
		 	hash={
				l:	left,
				left:left,
				r:right,
				right:right,
				t:top,
				top:top,
				up:top,
				b:bottom,
				bottom:bottom,
				down:bottom
			};
		direction=direction.toLowerCase();
		me.moveTo(hash[direction][0],hash[direction][1],me.animTest.call(me,arguments,animate,2));
	},
	 setLeftTop:function(left,top){
		var me=this,
			style=me.dom.style;
		style.left=me.addUnits(left);
		style.top=me.addUnits(top);
		return me;
	},
	getRegion:function(){
		return Ext.lib.Dom.getRegion(this.dom);
	},
	setBounds:function(x,y,width,height,animate){
		var me=this;
		if(!animate||!me.anim){
			me.setSize(width,height);
			me.setLocation(x,y);
		}else{
			me.anim({points:{to:[x,y]},
					 width:{to:me.adjustWidth(width)},
					 height:{to:me.adjustHeight(height)}},
					 me.preanim(arguments,4),
					'motion');
		}
		return me;
	},
	setRegion:function(region,animate){
		return this.setBounds(region.left,region.top,region.right-region.left,region.bottom-region.top,this.animTest.call(this,arguments,animate,1));
	}});
Ext.Element.addMethods({
	isScrollable:function(){
		var dom=this.dom;
		return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth;
	},
	scrollTo:function(side,value){
		this.dom["scroll"+(/top/i.test(side)?"Top":"Left")]=value;
		return this;
	},
	getScroll:function(){
		var d=this.dom,
			doc=document,
			body=doc.body,
			docElement=doc.documentElement,
			l,
			t,
			ret;
		if(d==doc||d==body){
			if(Ext.isIE&&Ext.isStrict){
				l=docElement.scrollLeft;
				t=docElement.scrollTop;
			}else{
				l=window.pageXOffset;
				t=window.pageYOffset;
			}
			ret={left:l||(body?body.scrollLeft:0),top:t||(body?body.scrollTop:0)};
		}else{
			ret={left:d.scrollLeft,top:d.scrollTop};
		}
		return ret;
	}});
Ext.Element.addMethods({
	scrollTo:function(side,value,animate){
		var tester=/top/i,
			prop="scroll"+(tester.test(side)?"Top":"Left"),
			me=this,
			dom=me.dom;
		if(!animate||!me.anim){
			dom[prop]=value;
		}else{
			me.anim({scroll:{to:tester.test(prop)?[dom[prop],value]:[value,dom[prop]]}},
					 me.preanim(arguments,2),'scroll');
		}
		return me;
	},
	scrollIntoView:function(container,hscroll){
		var c=Ext.getDom(container)||Ext.getBody().dom,
			el=this.dom,
			o=this.getOffsetsTo(c),
			l=o[0]+c.scrollLeft,
			t=o[1]+c.scrollTop,
			b=t+el.offsetHeight,
			r=l+el.offsetWidth,
			ch=c.clientHeight,
			ct=parseInt(c.scrollTop,10),
			cl=parseInt(c.scrollLeft,10),
			cb=ct+ch,
			cr=cl+c.clientWidth;
		if(el.offsetHeight>ch||t<ct){
			c.scrollTop=t;
		}else if(b>cb){
			c.scrollTop=b-ch;
		}
		c.scrollTop=c.scrollTop;
		if(hscroll!==false){
			if(el.offsetWidth>c.clientWidth||l<cl){
				c.scrollLeft=l;
			}else if(r>cr){
				c.scrollLeft=r-c.clientWidth;
			}
			c.scrollLeft=c.scrollLeft;
		}
		return this;
	},
	scrollChildIntoView:function(child,hscroll){
		Ext.fly(child,'_scrollChildIntoView').scrollIntoView(this,hscroll);
	},
	 scroll:function(direction,distance,animate){
		 if(!this.isScrollable()){
			 return;
		}
		 var el=this.dom,
			l=el.scrollLeft,t=el.scrollTop,
			w=el.scrollWidth,h=el.scrollHeight,
			cw=el.clientWidth,ch=el.clientHeight,
			scrolled=false,v,
			hash={
				l:Math.min(l+distance,w-cw),
				r:v=Math.max(l-distance,0),
				t:Math.max(t-distance,0),
				b:Math.min(t+distance,h-ch)
			};
			hash.d=hash.b;
			hash.u=hash.t;
		 direction=direction.substr(0,1);
		 if((v=hash[direction])>-1){
			scrolled=true;
			this.scrollTo(direction=='l'||direction=='r'?'left':'top',v,this.preanim(arguments,2));
		}
		 return scrolled;
	}});
Ext.Element.VISIBILITY=1;
Ext.Element.DISPLAY=2;
Ext.Element.addMethods(function(){
	var VISIBILITY="visibility",
		DISPLAY="display",
		HIDDEN="hidden",
		NONE="none",
		ORIGINALDISPLAY='originalDisplay',
		VISMODE='visibilityMode',
		ELDISPLAY=Ext.Element.DISPLAY,
		data=Ext.Element.data,
		getDisplay=function(dom){
			var d=data(dom,ORIGINALDISPLAY);
			if(d===undefined){
				data(dom,ORIGINALDISPLAY,d='');
			}
			return d;
		},
		getVisMode=function(dom){
			var m=data(dom,VISMODE);
			if(m===undefined){
				data(dom,VISMODE,m=1)
			}
			return m;
		};
	return{
		originalDisplay:"",
		visibilityMode:1,
		setVisibilityMode:function(visMode){
			data(this.dom,VISMODE,visMode);
			return this;
		},
		animate:function(args,duration,onComplete,easing,animType){
			this.anim(args,{duration:duration,callback:onComplete,easing:easing},animType);
			return this;
		},
		anim:function(args,opt,animType,defaultDur,defaultEase,cb){
			animType=animType||'run';
			opt=opt||{};
			var me=this,
				anim=Ext.lib.Anim[animType](
					me.dom,
					args,
					(opt.duration||defaultDur)||.35,
					(opt.easing||defaultEase)||'easeOut',
					function(){
						if(cb)cb.call(me);
						if(opt.callback)opt.callback.call(opt.scope||me,me,opt);
					},
					me
				);
			opt.anim=anim;
			return anim;
		},
		preanim:function(a,i){
			return!a[i]?false:(Ext.isObject(a[i])?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});
		},
		isVisible:function(){
			return!this.isStyle(VISIBILITY,HIDDEN)&&!this.isStyle(DISPLAY,NONE);
		},
		 setVisible:function(visible,animate){
			var me=this,
				dom=me.dom,
				isDisplay=getVisMode(this.dom)==ELDISPLAY;
			if(!animate||!me.anim){
				if(isDisplay){
					me.setDisplayed(visible);
				}else{
					me.fixDisplay();
					dom.style.visibility=visible?"visible":HIDDEN;
				}
			}else{
				if(visible){
					me.setOpacity(.01);
					me.setVisible(true);
				}
				me.anim({opacity:{to:(visible?1:0)}},
						me.preanim(arguments,1),
						null,
						.35,
						'easeIn',
						function(){
							 if(!visible){
								 dom.style[isDisplay?DISPLAY:VISIBILITY]=(isDisplay)?NONE:HIDDEN;
								 Ext.fly(dom).setOpacity(1);
							}
						});
			}
			return me;
		},
		toggle:function(animate){
			var me=this;
			me.setVisible(!me.isVisible(),me.preanim(arguments,0));
			return me;
		},
		setDisplayed:function(value){
			if(typeof value=="boolean"){
			 value=value?getDisplay(this.dom):NONE;
			}
			this.setStyle(DISPLAY,value);
			return this;
		},
		fixDisplay:function(){
			var me=this;
			if(me.isStyle(DISPLAY,NONE)){
				me.setStyle(VISIBILITY,HIDDEN);
				me.setStyle(DISPLAY,getDisplay(this.dom));
				if(me.isStyle(DISPLAY,NONE)){
					me.setStyle(DISPLAY,"block");
				}
			}
		},
		hide:function(animate){
			this.setVisible(false,this.preanim(arguments,0));
			return this;
		},
		show:function(animate){
			this.setVisible(true,this.preanim(arguments,0));
			return this;
		}
	}}());
Ext.Element.addMethods(
function(){
	var VISIBILITY="visibility",
		DISPLAY="display",
		HIDDEN="hidden",
		NONE="none",
		XMASKED="x-masked",
		XMASKEDRELATIVE="x-masked-relative",
		data=Ext.Element.data;
	return{
		isVisible:function(deep){
			var vis=!this.isStyle(VISIBILITY,HIDDEN)&&!this.isStyle(DISPLAY,NONE),
				p=this.dom.parentNode;
			if(deep!==true||!vis){
				return vis;
			}
			while(p&&!/body/i.test(p.tagName)){
				if(!Ext.fly(p,'_isVisible').isVisible()){
					return false;
				}
				p=p.parentNode;
			}
			return true;
		},
		isDisplayed:function(){
			return!this.isStyle(DISPLAY,NONE);
		},
		enableDisplayMode:function(display){
			this.setVisibilityMode(Ext.Element.DISPLAY);
			if(!Ext.isEmpty(display)){
				data(this.dom,'originalDisplay',display);
			}
			return this;
		},
		mask:function(msg,msgCls){
			var me=this,
				dom=me.dom,
				dh=Ext.DomHelper,
				EXTELMASKMSG="ext-el-mask-msg",
				el,
				mask;
			if(me.getStyle("position")=="static"){
				me.addClass(XMASKEDRELATIVE);
			}
			if((el=data(dom,'maskMsg'))){
				el.remove();
			}
			if((el=data(dom,'mask'))){
				el.remove();
			}
			mask=dh.append(dom,{cls:"ext-el-mask"},true);
			data(dom,'mask',mask);
			me.addClass(XMASKED);
			mask.setDisplayed(true);
			if(typeof msg=='string'){
				var mm=dh.append(dom,{cls:EXTELMASKMSG,cn:{tag:'div'}},true);
				data(dom,'maskMsg',mm);
				mm.dom.className=msgCls?EXTELMASKMSG+" "+msgCls:EXTELMASKMSG;
				mm.dom.firstChild.innerHTML=msg;
				mm.setDisplayed(true);
				mm.center(me);
			}
			if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&me.getStyle('height')=='auto'){
				mask.setSize(undefined,me.getHeight());
			}
			return mask;
		},
		unmask:function(){
			var me=this,
				dom=me.dom,
				mask=data(dom,'mask'),
				maskMsg=data(dom,'maskMsg');
			if(mask){
				if(maskMsg){
					maskMsg.remove();
					data(dom,'maskMsg',undefined);
				}
				mask.remove();
				data(dom,'mask',undefined);
			}
			me.removeClass([XMASKED,XMASKEDRELATIVE]);
		},
		isMasked:function(){
			var m=data(this.dom,'mask');
			return m&&m.isVisible();
		},
		createShim:function(){
			var el=document.createElement('iframe'),
				shim;
			el.frameBorder='0';
			el.className='ext-shim';
			if(Ext.isIE&&Ext.isSecure){
				el.src=Ext.SSL_SECURE_URL;
			}
			shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));
			shim.autoBoxAdjust=false;
			return shim;
		}
	};}());
Ext.Element.addMethods({
	addKeyListener:function(key,fn,scope){
		var config;
		if(!Ext.isObject(key)||Ext.isArray(key)){
			config={
				key:key,
				fn:fn,
				scope:scope
			};
		}else{
			config={
				key:key.key,
				shift:key.shift,
				ctrl:key.ctrl,
				alt:key.alt,
				fn:fn,
				scope:scope
			};
		}
		return new Ext.KeyMap(this,config);
	},
	addKeyMap:function(config){
		return new Ext.KeyMap(this,config);
	}});(function(){
	var NULL=null,
		UNDEFINED=undefined,
		TRUE=true,
		FALSE=false,
		SETX="setX",
		SETY="setY",
		SETXY="setXY",
		LEFT="left",
		BOTTOM="bottom",
		TOP="top",
		RIGHT="right",
		HEIGHT="height",
		WIDTH="width",
		POINTS="points",
		HIDDEN="hidden",
		ABSOLUTE="absolute",
		VISIBLE="visible",
		MOTION="motion",
		POSITION="position",
		EASEOUT="easeOut",
		flyEl=new Ext.Element.Flyweight(),
		queues={},
		getObject=function(o){
			return o||{};
		},
		fly=function(dom){
			flyEl.dom=dom;
			flyEl.id=Ext.id(dom);
			return flyEl;
		},
		getQueue=function(id){
			if(!queues[id]){
				queues[id]=[];
			}
			return queues[id];
		},
		setQueue=function(id,value){
			queues[id]=value;
		};
Ext.enableFx=TRUE;
Ext.Fx={
	switchStatements:function(key,fn,argHash){
		return fn.apply(this,argHash[key]);
	},
	slideIn:function(anchor,o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			st=dom.style,
			xy,
			r,
			b,
			wrap,
			after,
			st,
			args,
			pt,
			bw,
			bh;
		anchor=anchor||"t";
		me.queueFx(o,function(){
			xy=fly(dom).getXY();
			fly(dom).fixDisplay();
			r=fly(dom).getFxRestore();
			b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight};
			b.right=b.x+b.width;
			b.bottom=b.y+b.height;
			fly(dom).setWidth(b.width).setHeight(b.height);
			wrap=fly(dom).fxWrap(r.pos,o,HIDDEN);
			st.visibility=VISIBLE;
			st.position=ABSOLUTE;
			function after(){
				 fly(dom).fxUnwrap(wrap,r.pos,o);
				 st.width=r.width;
				 st.height=r.height;
				 fly(dom).afterFx(o);
			}
			pt={to:[b.x,b.y]};
			bw={to:b.width};
			bh={to:b.height};
			function argCalc(wrap,style,ww,wh,sXY,sXYval,s1,s2,w,h,p){
				var ret={};
				fly(wrap).setWidth(ww).setHeight(wh);
				if(fly(wrap)[sXY]){
					fly(wrap)[sXY](sXYval);
				}
				style[s1]=style[s2]="0";
				if(w){
					ret.width=w
				};
				if(h){
					ret.height=h;
				}
				if(p){
					ret.points=p;
				}
				return ret;
			};
			args=fly(dom).switchStatements(anchor.toLowerCase(),argCalc,{
					t:[wrap,st,b.width,0,NULL,NULL,LEFT,BOTTOM,NULL,bh,NULL],
					l:[wrap,st,0,b.height,NULL,NULL,RIGHT,TOP,bw,NULL,NULL],
					r:[wrap,st,b.width,b.height,SETX,b.right,LEFT,TOP,NULL,NULL,pt],
					b:[wrap,st,b.width,b.height,SETY,b.bottom,LEFT,TOP,NULL,bh,pt],
					tl:[wrap,st,0,0,NULL,NULL,RIGHT,BOTTOM,bw,bh,pt],
					bl:[wrap,st,0,0,SETY,b.y+b.height,RIGHT,TOP,bw,bh,pt],
					br:[wrap,st,0,0,SETXY,[b.right,b.bottom],LEFT,TOP,bw,bh,pt],
					tr:[wrap,st,0,0,SETX,b.x+b.width,LEFT,BOTTOM,bw,bh,pt]
				});
			st.visibility=VISIBLE;
			fly(wrap).show();
			arguments.callee.anim=fly(wrap).fxanim(args,
				o,
				MOTION,
				.5,
				EASEOUT,
				after);
		});
		return me;
	},
	slideOut:function(anchor,o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			st=dom.style,
			xy=me.getXY(),
			wrap,
			r,
			b,
			a,
			zero={to:0};
		anchor=anchor||"t";
		me.queueFx(o,function(){
			r=fly(dom).getFxRestore();
			b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight};
			b.right=b.x+b.width;
			b.bottom=b.y+b.height;
			fly(dom).setWidth(b.width).setHeight(b.height);
			wrap=fly(dom).fxWrap(r.pos,o,VISIBLE);
			st.visibility=VISIBLE;
			st.position=ABSOLUTE;
			fly(wrap).setWidth(b.width).setHeight(b.height);
			function after(){
				o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();
				fly(dom).fxUnwrap(wrap,r.pos,o);
				st.width=r.width;
				st.height=r.height;
				fly(dom).afterFx(o);
			}
			function argCalc(style,s1,s2,p1,v1,p2,v2,p3,v3){
				var ret={};
				style[s1]=style[s2]="0";
				ret[p1]=v1;
				if(p2){
					ret[p2]=v2;
				}
				if(p3){
					ret[p3]=v3;
				}
				return ret;
			};
			a=fly(dom).switchStatements(anchor.toLowerCase(),argCalc,{
				t:[st,LEFT,BOTTOM,HEIGHT,zero],
				l:[st,RIGHT,TOP,WIDTH,zero],
				r:[st,LEFT,TOP,WIDTH,zero,POINTS,{to:[b.right,b.y]}],
				b:[st,LEFT,TOP,HEIGHT,zero,POINTS,{to:[b.x,b.bottom]}],
				tl:[st,RIGHT,BOTTOM,WIDTH,zero,HEIGHT,zero],
				bl:[st,RIGHT,TOP,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.x,b.bottom]}],
				br:[st,LEFT,TOP,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.x+b.width,b.bottom]}],
				tr:[st,LEFT,BOTTOM,WIDTH,zero,HEIGHT,zero,POINTS,{to:[b.right,b.y]}]
			});
			arguments.callee.anim=fly(wrap).fxanim(a,
				o,
				MOTION,
				.5,
				EASEOUT,
				after);
		});
		return me;
	},
	puff:function(o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			st=dom.style,
			width,
			height,
			r;
		me.queueFx(o,function(){
			width=fly(dom).getWidth();
			height=fly(dom).getHeight();
			fly(dom).clearOpacity();
			fly(dom).show();
			r=fly(dom).getFxRestore();
			function after(){
				o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();
				fly(dom).clearOpacity();
				fly(dom).setPositioning(r.pos);
				st.width=r.width;
				st.height=r.height;
				st.fontSize='';
				fly(dom).afterFx(o);
			}
			arguments.callee.anim=fly(dom).fxanim({
					width:{to:fly(dom).adjustWidth(width*2)},
					height:{to:fly(dom).adjustHeight(height*2)},
					points:{by:[-width*.5,-height*.5]},
					opacity:{to:0},
					fontSize:{to:200,unit:"%"}
				},
				o,
				MOTION,
				.5,
				EASEOUT,
				 after);
		});
		return me;
	},
	switchOff:function(o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			st=dom.style,
			r;
		me.queueFx(o,function(){
			fly(dom).clearOpacity();
			fly(dom).clip();
			r=fly(dom).getFxRestore();
			function after(){
				o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();
				fly(dom).clearOpacity();
				fly(dom).setPositioning(r.pos);
				st.width=r.width;
				st.height=r.height;
				fly(dom).afterFx(o);
			};
			fly(dom).fxanim({opacity:{to:0.3}},
				NULL,
				NULL,
				.1,
				NULL,
				function(){
					fly(dom).clearOpacity();
						(function(){
							fly(dom).fxanim({
								height:{to:1},
								points:{by:[0,fly(dom).getHeight()*.5]}
							},
							o,
							MOTION,
							0.3,
							'easeIn',
							after);
						}).defer(100);
				});
		});
		return me;
	},
	highlight:function(color,o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			attr=o.attr||"backgroundColor",
			a={},
			restore;
		me.queueFx(o,function(){
			fly(dom).clearOpacity();
			fly(dom).show();
			function after(){
				dom.style[attr]=restore;
				fly(dom).afterFx(o);
			}
			restore=dom.style[attr];
			a[attr]={from:color||"ffff9c",to:o.endColor||fly(dom).getColor(attr)||"ffffff"};
			arguments.callee.anim=fly(dom).fxanim(a,
				o,
				'color',
				1,
				'easeIn',
				after);
		});
		return me;
	},
	frame:function(color,count,o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			proxy,
			active;
		me.queueFx(o,function(){
			color=color||"#C3DAF9"
			if(color.length==6){
				color="#"+color;
			}
			count=count||1;
			fly(dom).show();
			var xy=fly(dom).getXY(),
				b={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:dom.offsetWidth,height:dom.offsetHeight},
				queue=function(){
					proxy=fly(document.body||document.documentElement).createChild({
						style:{
							visbility:HIDDEN,
							position:ABSOLUTE,
							"z-index":35000,
							border:"0px solid "+color
						}
					});
					return proxy.queueFx({},animFn);
				};
			arguments.callee.anim={
				isAnimated:true,
				stop:function(){
					count=0;
					proxy.stopFx();
				}
			};
			function animFn(){
				var scale=Ext.isBorderBox?2:1;
				active=proxy.anim({
					top:{from:b.y,to:b.y-20},
					left:{from:b.x,to:b.x-20},
					borderWidth:{from:0,to:10},
					opacity:{from:1,to:0},
					height:{from:b.height,to:b.height+20*scale},
					width:{from:b.width,to:b.width+20*scale}
				},{
					duration:o.duration||1,
					callback:function(){
						proxy.remove();
						--count>0?queue():fly(dom).afterFx(o);
					}
				});
				arguments.callee.anim={
					isAnimated:true,
					stop:function(){
						active.stop();
					}
				};
			};
			queue();
		});
		return me;
	},
	pause:function(seconds){
		var dom=this.dom,
			t;
		this.queueFx({},function(){
			t=setTimeout(function(){
				fly(dom).afterFx({});
			},seconds*1000);
			arguments.callee.anim={
				isAnimated:true,
				stop:function(){
					clearTimeout(t);
					fly(dom).afterFx({});
				}
			};
		});
		return this;
	},
	fadeIn:function(o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			to=o.endOpacity||1;
		me.queueFx(o,function(){
			fly(dom).setOpacity(0);
			fly(dom).fixDisplay();
			dom.style.visibility=VISIBLE;
			arguments.callee.anim=fly(dom).fxanim({opacity:{to:to}},
				o,NULL,.5,EASEOUT,function(){
				if(to==1){
					fly(dom).clearOpacity();
				}
				fly(dom).afterFx(o);
			});
		});
		return me;
	},
	fadeOut:function(o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			style=dom.style,
			to=o.endOpacity||0;
		me.queueFx(o,function(){
			arguments.callee.anim=fly(dom).fxanim({
				opacity:{to:to}},
				o,
				NULL,
				.5,
				EASEOUT,
				function(){
					if(to==0){
						Ext.Element.data(dom,'visibilityMode')==Ext.Element.DISPLAY||o.useDisplay?
							style.display="none":
							style.visibility=HIDDEN;
						fly(dom).clearOpacity();
					}
					fly(dom).afterFx(o);
			});
		});
		return me;
	},
	scale:function(w,h,o){
		this.shift(Ext.apply({},o,{
			width:w,
			height:h
		}));
		return this;
	},
	shift:function(o){
		o=getObject(o);
		var dom=this.dom,
			a={};
		this.queueFx(o,function(){
			for(var prop in o){
				if(o[prop]!=UNDEFINED){
					a[prop]={to:o[prop]};
				}
			}
			a.width?a.width.to=fly(dom).adjustWidth(o.width):a;
			a.height?a.height.to=fly(dom).adjustWidth(o.height):a;
			if(a.x||a.y||a.xy){
				a.points=a.xy||
						{to:[a.x?a.x.to:fly(dom).getX(),
								 a.y?a.y.to:fly(dom).getY()]};
			}
			arguments.callee.anim=fly(dom).fxanim(a,
				o,
				MOTION,
				.35,
				EASEOUT,
				function(){
					fly(dom).afterFx(o);
				});
		});
		return this;
	},
	ghost:function(anchor,o){
		o=getObject(o);
		var me=this,
			dom=me.dom,
			st=dom.style,
			a={opacity:{to:0},points:{}},
			pt=a.points,
			r,
			w,
			h;
		anchor=anchor||"b";
		me.queueFx(o,function(){
			r=fly(dom).getFxRestore();
			w=fly(dom).getWidth();
			h=fly(dom).getHeight();
			function after(){
				o.useDisplay?fly(dom).setDisplayed(FALSE):fly(dom).hide();
				fly(dom).clearOpacity();
				fly(dom).setPositioning(r.pos);
				st.width=r.width;
				st.height=r.height;
				fly(dom).afterFx(o);
			}
			pt.by=fly(dom).switchStatements(anchor.toLowerCase(),function(v1,v2){return[v1,v2];},{
			 t:[0,-h],
			 l:[-w,0],
			 r:[w,0],
			 b:[0,h],
			 tl:[-w,-h],
			 bl:[-w,h],
			 br:[w,h],
			 tr:[w,-h]
			});
			arguments.callee.anim=fly(dom).fxanim(a,
				o,
				MOTION,
				.5,
				EASEOUT,after);
		});
		return me;
	},
	syncFx:function(){
		var me=this;
		me.fxDefaults=Ext.apply(me.fxDefaults||{},{
			block:FALSE,
			concurrent:TRUE,
			stopFx:FALSE
		});
		return me;
	},
	sequenceFx:function(){
		var me=this;
		me.fxDefaults=Ext.apply(me.fxDefaults||{},{
			block:FALSE,
			concurrent:FALSE,
			stopFx:FALSE
		});
		return me;
	},
	nextFx:function(){
		var ef=getQueue(this.dom.id)[0];
		if(ef){
			ef.call(this);
		}
	},
	hasActiveFx:function(){
		return getQueue(this.dom.id)[0];
	},
	stopFx:function(finish){
		var me=this,
			id=me.dom.id;
		if(me.hasActiveFx()){
			var cur=getQueue(id)[0];
			if(cur&&cur.anim){
				if(cur.anim.isAnimated){
					setQueue(id,[cur]);
					cur.anim.stop(finish!==undefined?finish:TRUE);
				}else{
					setQueue(id,[]);
				}
			}
		}
		return me;
	},
	beforeFx:function(o){
		if(this.hasActiveFx()&&!o.concurrent){
		 if(o.stopFx){
			 this.stopFx();
			 return TRUE;
		}
		 return FALSE;
		}
		return TRUE;
	},
	hasFxBlock:function(){
		var q=getQueue(this.dom.id);
		return q&&q[0]&&q[0].block;
	},
	queueFx:function(o,fn){
		var me=this;
		if(!me.hasFxBlock()){
			Ext.applyIf(o,me.fxDefaults);
			if(!o.concurrent){
				var run=me.beforeFx(o);
				fn.block=o.block;
				getQueue(me.dom.id).push(fn);
				if(run){
					me.nextFx();
				}
			}else{
				fn.call(me);
			}
		}
		return me;
	},
	fxWrap:function(pos,o,vis){
		var dom=this.dom,
			wrap,
			wrapXY;
		if(!o.wrap||!(wrap=Ext.getDom(o.wrap))){
			if(o.fixPosition){
				wrapXY=fly(dom).getXY();
			}
			var div=document.createElement("div");
			div.style.visibility=vis;
			wrap=dom.parentNode.insertBefore(div,dom);
			fly(wrap).setPositioning(pos);
			if(fly(wrap).isStyle(POSITION,"static")){
				fly(wrap).position("relative");
			}
			fly(dom).clearPositioning('auto');
			fly(wrap).clip();
			wrap.appendChild(dom);
			if(wrapXY){
				fly(wrap).setXY(wrapXY);
			}
		}
		return wrap;
	},
	fxUnwrap:function(wrap,pos,o){
		var dom=this.dom;
		fly(dom).clearPositioning();
		fly(dom).setPositioning(pos);
		if(!o.wrap){
			wrap.parentNode.insertBefore(dom,wrap);
			fly(wrap).remove();
		}
	},
	getFxRestore:function(){
		var st=this.dom.style;
		return{pos:this.getPositioning(),width:st.width,height:st.height};
	},
	afterFx:function(o){
		var dom=this.dom,
			id=dom.id,
			notConcurrent=!o.concurrent;
		if(o.afterStyle){
			fly(dom).setStyle(o.afterStyle);
		}
		if(o.afterCls){
			fly(dom).addClass(o.afterCls);
		}
		if(o.remove==TRUE){
			fly(dom).remove();
		}
		if(notConcurrent){
			getQueue(id).shift();
		}
		if(o.callback){
			o.callback.call(o.scope,fly(dom));
		}
		if(notConcurrent){
			fly(dom).nextFx();
		}
	},
	fxanim:function(args,opt,animType,defaultDur,defaultEase,cb){
		animType=animType||'run';
		opt=opt||{};
		var anim=Ext.lib.Anim[animType](
				this.dom,
				args,
				(opt.duration||defaultDur)||.35,
				(opt.easing||defaultEase)||EASEOUT,
				cb,
				this
			);
		opt.anim=anim;
		return anim;
	}};
Ext.Fx.resize=Ext.Fx.scale;
Ext.Element.addMethods(Ext.Fx);})();
Ext.CompositeElementLite=function(els,root){
	this.elements=[];
	this.add(els,root);
	this.el=new Ext.Element.Flyweight();};
Ext.CompositeElementLite.prototype={
	isComposite:true,
	getCount:function(){
		return this.elements.length;
	},
	add:function(els){
		if(els){
			if(Ext.isArray(els)){
				this.elements=this.elements.concat(els);
			}else{
				var yels=this.elements;
				Ext.each(els,function(e){
					yels.push(e);
				});
			}
		}
		return this;
	},
	invoke:function(fn,args){
		var els=this.elements,
			el=this.el;
		Ext.each(els,function(e){
			el.dom=e;
			Ext.Element.prototype[fn].apply(el,args);
		});
		return this;
	},
	item:function(index){
		var me=this;
		if(!me.elements[index]){
			return null;
		}
		me.el.dom=me.elements[index];
		return me.el;
	},
	addListener:function(eventName,handler,scope,opt){
		Ext.each(this.elements,function(e){
			Ext.EventManager.on(e,eventName,handler,scope||e,opt);
		});
		return this;
	},
	each:function(fn,scope){
		var me=this,
			el=me.el;
		Ext.each(me.elements,function(e,i){
			el.dom=e;
			return fn.call(scope||el,el,me,i);
		});
		return me;
	},
	indexOf:function(el){
		return this.elements.indexOf(Ext.getDom(el));
	},
	replaceElement:function(el,replacement,domReplace){
		var index=!isNaN(el)?el:this.indexOf(el),
			d;
		if(index>-1){
			replacement=Ext.getDom(replacement);
			if(domReplace){
				d=this.elements[index];
				d.parentNode.insertBefore(replacement,d);
				Ext.removeNode(d);
			}
			this.elements.splice(index,1,replacement);
		}
		return this;
	},
	clear:function(){
		this.elements=[];
	}};
Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;
(function(){
var fnName,
	ElProto=Ext.Element.prototype,
	CelProto=Ext.CompositeElementLite.prototype;
for(fnName in ElProto){
	if(Ext.isFunction(ElProto[fnName])){
		(function(fnName){
			CelProto[fnName]=CelProto[fnName]||function(){
				return this.invoke(fnName,arguments);
			};
		}).call(CelProto,fnName);
	}}})();
if(Ext.DomQuery){
	Ext.Element.selectorFunction=Ext.DomQuery.select;}
Ext.Element.select=function(selector,unique,root){
	var els;
	if(typeof selector=="string"){
		els=Ext.Element.selectorFunction(selector,root);
	}else if(selector.length!==undefined){
		els=selector;
	}else{
		throw"Invalid selector";
	}
	return new Ext.CompositeElementLite(els);};
Ext.select=Ext.Element.select;
Ext.apply(Ext.CompositeElementLite.prototype,{
	addElements:function(els,root){
		if(!els){
			return this;
		}
		if(typeof els=="string"){
			els=Ext.Element.selectorFunction(els,root);
		}
		var yels=this.elements;
		Ext.each(els,function(e){
			yels.push(Ext.get(e));
		});
		return this;
	},
	fill:function(els){
		this.elements=[];
		this.add(els);
		return this;
	},
	first:function(){
		return this.item(0);
	},
	last:function(){
		return this.item(this.getCount()-1);
	},
	contains:function(el){
		return this.indexOf(el)!=-1;
	},
	filter:function(selector){
		var els=[];
		this.each(function(el){
			if(el.is(selector)){
				els[els.length]=el.dom;
			}
		});
		this.fill(els);
		return this;
	},
	removeElement:function(keys,removeDom){
		var me=this,
			els=this.elements,
			el;
		Ext.each(keys,function(val){
			if((el=(els[val]||els[val=me.indexOf(val)]))){
				if(removeDom){
					if(el.dom){
						el.remove();
					}else{
						Ext.removeNode(el);
					}
				}
				els.splice(val,1);
			}
		});
		return this;
	}});
Ext.CompositeElement=function(els,root){
	this.elements=[];
	this.add(els,root);};
Ext.extend(Ext.CompositeElement,Ext.CompositeElementLite,{
	invoke:function(fn,args){
		Ext.each(this.elements,function(e){
			Ext.Element.prototype[fn].apply(e,args);
		});
		return this;
	},
	add:function(els,root){
		if(!els){
			return this;
		}
		if(typeof els=="string"){
			els=Ext.Element.selectorFunction(els,root);
		}
		var yels=this.elements;
		Ext.each(els,function(e){
			yels.push(Ext.get(e));
		});
		return this;
	},
	item:function(index){
		return this.elements[index]||null;
	},
	indexOf:function(el){
		return this.elements.indexOf(Ext.get(el));
	},
	filter:function(selector){
		var me=this,
			out=[];
		Ext.each(me.elements,function(el){
			if(el.is(selector)){
				out.push(Ext.get(el));
			}
		});
		me.elements=out;
		return me;
	},
	each:function(fn,scope){
		Ext.each(this.elements,function(e,i){
			return fn.call(scope||e,e,this,i);
		},this);
		return this;
	}});
Ext.Element.select=function(selector,unique,root){
	var els;
	if(typeof selector=="string"){
		els=Ext.Element.selectorFunction(selector,root);
	}else if(selector.length!==undefined){
		els=selector;
	}else{
		throw"Invalid selector";
	}
	return(unique===true)?new Ext.CompositeElement(els):new Ext.CompositeElementLite(els);};
Ext.select=Ext.Element.select;(function(){
	var BEFOREREQUEST="beforerequest",
		REQUESTCOMPLETE="requestcomplete",
		REQUESTEXCEPTION="requestexception",
		UNDEFINED=undefined,
		LOAD='load',
		POST='POST',
		GET='GET',
		WINDOW=window;
	Ext.data.Connection=function(config){
		Ext.apply(this,config);
		this.addEvents(
			BEFOREREQUEST,
			REQUESTCOMPLETE,
			REQUESTEXCEPTION
		);
		Ext.data.Connection.superclass.constructor.call(this);
	};
	function handleResponse(response){
		this.transId=false;
		var options=response.argument.options;
		response.argument=options?options.argument:null;
		this.fireEvent(REQUESTCOMPLETE,this,response,options);
		if(options.success){
			options.success.call(options.scope,response,options);
		}
		if(options.callback){
			options.callback.call(options.scope,options,true,response);
		}
	}
	function handleFailure(response,e){
		this.transId=false;
		var options=response.argument.options;
		response.argument=options?options.argument:null;
		this.fireEvent(REQUESTEXCEPTION,this,response,options,e);
		if(options.failure){
			options.failure.call(options.scope,response,options);
		}
		if(options.callback){
			options.callback.call(options.scope,options,false,response);
		}
	}
	function doFormUpload(o,ps,url){
		var id=Ext.id(),
			doc=document,
			frame=doc.createElement('iframe'),
			form=Ext.getDom(o.form),
			hiddens=[],
			hd,
			encoding='multipart/form-data',
			buf={
				target:form.target,
				method:form.method,
				encoding:form.encoding,
				enctype:form.enctype,
				action:form.action
			};
		Ext.apply(frame,{
			id:id,
			name:id,
			className:'x-hidden',
			src:Ext.SSL_SECURE_URL
		});
		doc.body.appendChild(frame);
		if(Ext.isIE){
		 document.frames[id].name=id;
		}
		Ext.apply(form,{
			target:id,
			method:POST,
			enctype:encoding,
			encoding:encoding,
			action:url||buf.action
		});
		ps=Ext.urlDecode(ps,false);
		for(var k in ps){
			if(ps.hasOwnProperty(k)){
				hd=doc.createElement('input');
				hd.type='hidden';
				hd.value=ps[hd.name=k];
				form.appendChild(hd);
				hiddens.push(hd);
			}
		}
		function cb(){
			var me=this,
				r={responseText:'',
					 responseXML:null,
					 argument:o.argument},
				doc,
				firstChild;
			try{
				doc=frame.contentWindow.document||frame.contentDocument||WINDOW.frames[id].document;
				if(doc){
					if(doc.body){
						if(/textarea/i.test((firstChild=doc.body.firstChild||{}).tagName)){
							r.responseText=firstChild.value;
						}else{
							r.responseText=doc.body.innerHTML;
						}
					}
					r.responseXML=doc.XMLDocument||doc;
				}
			}
			catch(e){}
			Ext.EventManager.removeListener(frame,LOAD,cb,me);
			me.fireEvent(REQUESTCOMPLETE,me,r,o);
			function runCallback(fn,scope,args){
				if(Ext.isFunction(fn)){
					fn.apply(scope,args);
				}
			}
			runCallback(o.success,o.scope,[r,o]);
			runCallback(o.callback,o.scope,[o,true,r]);
			if(!me.debugUploads){
				setTimeout(function(){Ext.removeNode(frame);},100);
			}
		}
		Ext.EventManager.on(frame,LOAD,cb,this);
		form.submit();
		Ext.apply(form,buf);
		Ext.each(hiddens,function(h){
			Ext.removeNode(h);
		});
	}
	Ext.extend(Ext.data.Connection,Ext.util.Observable,{
		timeout:30000,
		autoAbort:false,
		disableCaching:true,
		disableCachingParam:'_dc',
		request:function(o){
			var me=this;
			if(me.fireEvent(BEFOREREQUEST,me,o)){
				if(o.el){
					if(!Ext.isEmpty(o.indicatorText)){
						me.indicatorText='<div class="loading-indicator">'+o.indicatorText+"</div>";
					}
					if(me.indicatorText){
						Ext.getDom(o.el).innerHTML=me.indicatorText;
					}
					o.success=(Ext.isFunction(o.success)?o.success:function(){}).createInterceptor(function(response){
						Ext.getDom(o.el).innerHTML=response.responseText;
					});
				}
				var p=o.params,
					url=o.url||me.url,
					method,
					cb={success:handleResponse,
						 failure:handleFailure,
						 scope:me,
						 argument:{options:o},
						 timeout:o.timeout||me.timeout
					},
					form,
					serForm;
				if(Ext.isFunction(p)){
					p=p.call(o.scope||WINDOW,o);
				}
				p=Ext.urlEncode(me.extraParams,Ext.isObject(p)?Ext.urlEncode(p):p);
				if(Ext.isFunction(url)){
					url=url.call(o.scope||WINDOW,o);
				}
				if((form=Ext.getDom(o.form))){
					url=url||form.action;
					 if(o.isUpload||/multipart\/form-data/i.test(form.getAttribute("enctype"))){
						 return doFormUpload.call(me,o,p,url);
					}
					serForm=Ext.lib.Ajax.serializeForm(form);
					p=p?(p+'&'+serForm):serForm;
				}
				method=o.method||me.method||((p||o.xmlData||o.jsonData)?POST:GET);
				if(method===GET&&(me.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){
					var dcp=o.disableCachingParam||me.disableCachingParam;
					url=Ext.urlAppend(url,dcp+'='+(new Date().getTime()));
				}
				o.headers=Ext.apply(o.headers||{},me.defaultHeaders||{});
				if(o.autoAbort===true||me.autoAbort){
					me.abort();
				}
				if((method==GET||o.xmlData||o.jsonData)&&p){
					url=Ext.urlAppend(url,p);
					p='';
				}
				return(me.transId=Ext.lib.Ajax.request(method,url,cb,p,o));
			}else{
				return o.callback?o.callback.apply(o.scope,[o,UNDEFINED,UNDEFINED]):null;
			}
		},
		isLoading:function(transId){
			return transId?Ext.lib.Ajax.isCallInProgress(transId):!!this.transId;
		},
		abort:function(transId){
			if(transId||this.isLoading()){
				Ext.lib.Ajax.abort(transId||this.transId);
			}
		}
	});})();
Ext.Ajax=new Ext.data.Connection({
	autoAbort:false,
	serializeForm:function(form){
		return Ext.lib.Ajax.serializeForm(form);
	}});
Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,
function(){
	var BEFOREUPDATE="beforeupdate",
		UPDATE="update",
		FAILURE="failure";
	function processSuccess(response){
		var me=this;
		me.transaction=null;
		if(response.argument.form&&response.argument.reset){
			try{
				response.argument.form.reset();
			}catch(e){}
		}
		if(me.loadScripts){
			me.renderer.render(me.el,response,me,
			 updateComplete.createDelegate(me,[response]));
		}else{
			me.renderer.render(me.el,response,me);
			updateComplete.call(me,response);
		}
	}
	function updateComplete(response,type,success){
		this.fireEvent(type||UPDATE,this.el,response);
		if(Ext.isFunction(response.argument.callback)){
			response.argument.callback.call(response.argument.scope,this.el,Ext.isEmpty(success)?true:false,response,response.argument.options);
		}
	}
	function processFailure(response){
		updateComplete.call(this,response,FAILURE,!!(this.transaction=null));
	}
	return{
		constructor:function(el,forceNew){
			var me=this;
			el=Ext.get(el);
			if(!forceNew&&el.updateManager){
				return el.updateManager;
			}
			me.el=el;
			me.defaultUrl=null;
			me.addEvents(
				BEFOREUPDATE,
				UPDATE,
				FAILURE
			);
			Ext.apply(me,Ext.Updater.defaults);
			me.transaction=null;
			me.refreshDelegate=me.refresh.createDelegate(me);
			me.updateDelegate=me.update.createDelegate(me);
			me.formUpdateDelegate=(me.formUpdate||function(){}).createDelegate(me);
			me.renderer=me.renderer||me.getDefaultRenderer();
			Ext.Updater.superclass.constructor.call(me);
		},
		setRenderer:function(renderer){
			this.renderer=renderer;
		},
		getRenderer:function(){
		 return this.renderer;
		},
		getDefaultRenderer:function(){
			return new Ext.Updater.BasicRenderer();
		},
		setDefaultUrl:function(defaultUrl){
			this.defaultUrl=defaultUrl;
		},
		getEl:function(){
			return this.el;
		},
		update:function(url,params,callback,discardUrl){
			var me=this,
				cfg,
				callerScope;
			if(me.fireEvent(BEFOREUPDATE,me.el,url,params)!==false){
				if(Ext.isObject(url)){
					cfg=url;
					url=cfg.url;
					params=params||cfg.params;
					callback=callback||cfg.callback;
					discardUrl=discardUrl||cfg.discardUrl;
					callerScope=cfg.scope;
					if(!Ext.isEmpty(cfg.nocache)){me.disableCaching=cfg.nocache;};
					if(!Ext.isEmpty(cfg.text)){me.indicatorText='<div class="loading-indicator">'+cfg.text+"</div>";};
					if(!Ext.isEmpty(cfg.scripts)){me.loadScripts=cfg.scripts;};
					if(!Ext.isEmpty(cfg.timeout)){me.timeout=cfg.timeout;};
				}
				me.showLoading();
				if(!discardUrl){
					me.defaultUrl=url;
				}
				if(Ext.isFunction(url)){
					url=url.call(me);
				}
				var o=Ext.apply({},{
					url:url,
					params:(Ext.isFunction(params)&&callerScope)?params.createDelegate(callerScope):params,
					success:processSuccess,
					failure:processFailure,
					scope:me,
					callback:undefined,
					timeout:(me.timeout*1000),
					disableCaching:me.disableCaching,
					argument:{
						"options":cfg,
						"url":url,
						"form":null,
						"callback":callback,
						"scope":callerScope||window,
						"params":params
					}
				},cfg);
				me.transaction=Ext.Ajax.request(o);
			}
		},
		formUpdate:function(form,url,reset,callback){
			var me=this;
			if(me.fireEvent(BEFOREUPDATE,me.el,form,url)!==false){
				if(Ext.isFunction(url)){
					url=url.call(me);
				}
				form=Ext.getDom(form)
				me.transaction=Ext.Ajax.request({
					form:form,
					url:url,
					success:processSuccess,
					failure:processFailure,
					scope:me,
					timeout:(me.timeout*1000),
					argument:{
						"url":url,
						"form":form,
						"callback":callback,
						"reset":reset
					}
				});
				me.showLoading.defer(1,me);
			}
		},
		startAutoRefresh:function(interval,url,params,callback,refreshNow){
			var me=this;
			if(refreshNow){
				me.update(url||me.defaultUrl,params,callback,true);
			}
			if(me.autoRefreshProcId){
				clearInterval(me.autoRefreshProcId);
			}
			me.autoRefreshProcId=setInterval(me.update.createDelegate(me,[url||me.defaultUrl,params,callback,true]),interval*1000);
		},
		stopAutoRefresh:function(){
			if(this.autoRefreshProcId){
				clearInterval(this.autoRefreshProcId);
				delete this.autoRefreshProcId;
			}
		},
		isAutoRefreshing:function(){
		 return!!this.autoRefreshProcId;
		},
		showLoading:function(){
			if(this.showLoadIndicator){
				this.el.dom.innerHTML=this.indicatorText;
			}
		},
		abort:function(){
			if(this.transaction){
				Ext.Ajax.abort(this.transaction);
			}
		},
		isUpdating:function(){
			return this.transaction?Ext.Ajax.isLoading(this.transaction):false;
		},
		refresh:function(callback){
			if(this.defaultUrl){
				this.update(this.defaultUrl,null,callback,true);
			}
		}
	}}());
Ext.Updater.defaults={
	timeout:30,
	disableCaching:false,
	showLoadIndicator:true,
	indicatorText:'<div class="loading-indicator">Loading...</div>',
	loadScripts:false,
	sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false")};
Ext.Updater.updateElement=function(el,url,params,options){
	var um=Ext.get(el).getUpdater();
	Ext.apply(um,options);
	um.update(url,params,options?options.callback:null);};
Ext.Updater.BasicRenderer=function(){};
Ext.Updater.BasicRenderer.prototype={
	 render:function(el,response,updateManager,callback){
		el.update(response.responseText,updateManager.loadScripts,callback);
	}};
(function(){
Date.useStrict=false;
function xf(format){
	var args=Array.prototype.slice.call(arguments,1);
	return format.replace(/\{(\d+)\}/g,function(m,i){
		return args[i];
	});}
Date.formatCodeToRegex=function(character,currentGroup){
	var p=Date.parseCodes[character];
	if(p){
	 p=typeof p=='function'?p():p;
	 Date.parseCodes[character]=p;
	}
	return p?Ext.applyIf({
	 c:p.c?xf(p.c,currentGroup||"{0}"):p.c
	},p):{
		g:0,
		c:null,
		s:Ext.escapeRe(character)
	}}
var $f=Date.formatCodeToRegex;
Ext.apply(Date,{
	parseFunctions:{
		"M$":function(input,strict){
			var re=new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/');
			var r=(input||'').match(re);
			return r?new Date(((r[1]||'')+r[2])*1):null;
		}
	},
	parseRegexes:[],
	formatFunctions:{
		"M$":function(){
			return'\\/Date('+this.getTime()+')\\/';
		}
	},
	y2kYear:50,
	MILLI:"ms",
	SECOND:"s",
	MINUTE:"mi",
	HOUR:"h",
	DAY:"d",
	MONTH:"mo",
	YEAR:"y",
	defaults:{},
	dayNames:[
		"Sunday",
		"Monday",
		"Tuesday",
		"Wednesday",
		"Thursday",
		"Friday",
		"Saturday"
	],
	monthNames:[
		"January",
		"February",
		"March",
		"April",
		"May",
		"June",
		"July",
		"August",
		"September",
		"October",
		"November",
		"December"
	],
	monthNumbers:{
		Jan:0,
		Feb:1,
		Mar:2,
		Apr:3,
		May:4,
		Jun:5,
		Jul:6,
		Aug:7,
		Sep:8,
		Oct:9,
		Nov:10,
		Dec:11
	},
	getShortMonthName:function(month){
		return Date.monthNames[month].substring(0,3);
	},
	getShortDayName:function(day){
		return Date.dayNames[day].substring(0,3);
	},
	getMonthNumber:function(name){
		return Date.monthNumbers[name.substring(0,1).toUpperCase()+name.substring(1,3).toLowerCase()];
	},
	formatCodes:{
		d:"String.leftPad(this.getDate(), 2, '0')",
		D:"Date.getShortDayName(this.getDay())",
		j:"this.getDate()",
		l:"Date.dayNames[this.getDay()]",
		N:"(this.getDay() ? this.getDay() : 7)",
		S:"this.getSuffix()",
		w:"this.getDay()",
		z:"this.getDayOfYear()",
		W:"String.leftPad(this.getWeekOfYear(), 2, '0')",
		F:"Date.monthNames[this.getMonth()]",
		m:"String.leftPad(this.getMonth() + 1, 2, '0')",
		M:"Date.getShortMonthName(this.getMonth())",
		n:"(this.getMonth() + 1)",
		t:"this.getDaysInMonth()",
		L:"(this.isLeapYear() ? 1 : 0)",
		o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",
		Y:"this.getFullYear()",
		y:"('' + this.getFullYear()).substring(2, 4)",
		a:"(this.getHours() < 12 ? 'am' : 'pm')",
		A:"(this.getHours() < 12 ? 'AM' : 'PM')",
		g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",
		G:"this.getHours()",
		h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",
		H:"String.leftPad(this.getHours(), 2, '0')",
		i:"String.leftPad(this.getMinutes(), 2, '0')",
		s:"String.leftPad(this.getSeconds(), 2, '0')",
		u:"String.leftPad(this.getMilliseconds(), 3, '0')",
		O:"this.getGMTOffset()",
		P:"this.getGMTOffset(true)",
		T:"this.getTimezone()",
		Z:"(this.getTimezoneOffset() * -60)",
		c:function(){
			for(var c="Y-m-dTH:i:sP",code=[],i=0,l=c.length;i<l;++i){
				var e=c.charAt(i);
				code.push(e=="T"?"'T'":Date.getFormatCode(e));
			}
			return code.join(" + ");
		},
		U:"Math.round(this.getTime() / 1000)"
	},
	isValid:function(y,m,d,h,i,s,ms){
		h=h||0;
		i=i||0;
		s=s||0;
		ms=ms||0;
		var dt=new Date(y,m-1,d,h,i,s,ms);
		return y==dt.getFullYear()&&
			m==dt.getMonth()+1&&
			d==dt.getDate()&&
			h==dt.getHours()&&
			i==dt.getMinutes()&&
			s==dt.getSeconds()&&
			ms==dt.getMilliseconds();
	},
	parseDate:function(input,format,strict){
		var p=Date.parseFunctions;
		if(p[format]==null){
			Date.createParser(format);
		}
		return p[format](input,Ext.isDefined(strict)?strict:Date.useStrict);
	},
	getFormatCode:function(character){
		var f=Date.formatCodes[character];
		if(f){
		 f=typeof f=='function'?f():f;
		 Date.formatCodes[character]=f;
		}
		return f||("'"+String.escape(character)+"'");
	},
	createFormat:function(format){
		var code=[],
			special=false,
			ch='';
		for(var i=0;i<format.length;++i){
			ch=format.charAt(i);
			if(!special&&ch=="\\"){
				special=true;
			}else if(special){
				special=false;
				code.push("'"+String.escape(ch)+"'");
			}else{
				code.push(Date.getFormatCode(ch))
			}
		}
		Date.formatFunctions[format]=new Function("return "+code.join('+'));
	},
	createParser:function(){
		var code=[
			"var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,",
				"def = Date.defaults,",
				"results = String(input).match(Date.parseRegexes[{0}]);",
			"if(results){",
				"{1}",
				"if(u != null){",
					"v = new Date(u * 1000);",
				"}else{",
					"dt = (new Date()).clearTime();",
					"y = y >= 0? y : Ext.num(def.y, dt.getFullYear());",
					"m = m >= 0? m : Ext.num(def.m - 1, dt.getMonth());",
					"d = d >= 0? d : Ext.num(def.d, dt.getDate());",
					"h  = h || Ext.num(def.h, dt.getHours());",
					"i  = i || Ext.num(def.i, dt.getMinutes());",
					"s  = s || Ext.num(def.s, dt.getSeconds());",
					"ms = ms || Ext.num(def.ms, dt.getMilliseconds());",
					"if(z >= 0 && y >= 0){",
						"v = new Date(y, 0, 1, h, i, s, ms);",
						"v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);",
					"}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){",
						"v = null;",
					"}else{",
						"v = new Date(y, m, d, h, i, s, ms);",
					"}",
				"}",
			"}",
			"if(v){",
				"if(zz != null){",
					"v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);",
				"}else if(o){",
					"v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
				"}",
			"}",
			"return v;"
		].join('\n');
		return function(format){
			var regexNum=Date.parseRegexes.length,
				currentGroup=1,
				calc=[],
				regex=[],
				special=false,
				ch="";
			for(var i=0;i<format.length;++i){
				ch=format.charAt(i);
				if(!special&&ch=="\\"){
					special=true;
				}else if(special){
					special=false;
					regex.push(String.escape(ch));
				}else{
					var obj=$f(ch,currentGroup);
					currentGroup+=obj.g;
					regex.push(obj.s);
					if(obj.g&&obj.c){
						calc.push(obj.c);
					}
				}
			}
			Date.parseRegexes[regexNum]=new RegExp("^"+regex.join('')+"$","i");
			Date.parseFunctions[format]=new Function("input","strict",xf(code,regexNum,calc.join('')));
		}
	}(),
	parseCodes:{
		d:{
			g:1,
			c:"d = parseInt(results[{0}], 10);\n",
			s:"(\\d{2})"
		},
		j:{
			g:1,
			c:"d = parseInt(results[{0}], 10);\n",
			s:"(\\d{1,2})"
		},
		D:function(){
			for(var a=[],i=0;i<7;a.push(Date.getShortDayName(i)),++i);
			return{
				g:0,
				c:null,
				s:"(?:"+a.join("|")+")"
			}
		},
		l:function(){
			return{
				g:0,
				c:null,
				s:"(?:"+Date.dayNames.join("|")+")"
			}
		},
		N:{
			g:0,
			c:null,
			s:"[1-7]"
		},
		S:{
			g:0,
			c:null,
			s:"(?:st|nd|rd|th)"
		},
		w:{
			g:0,
			c:null,
			s:"[0-6]"
		},
		z:{
			g:1,
			c:"z = parseInt(results[{0}], 10);\n",
			s:"(\\d{1,3})"
		},
		W:{
			g:0,
			c:null,
			s:"(?:\\d{2})"
		},
		F:function(){
			return{
				g:1,
				c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",
				s:"("+Date.monthNames.join("|")+")"
			}
		},
		M:function(){
			for(var a=[],i=0;i<12;a.push(Date.getShortMonthName(i)),++i);
			return Ext.applyIf({
				s:"("+a.join("|")+")"
			},$f("F"));
		},
		m:{
			g:1,
			c:"m = parseInt(results[{0}], 10) - 1;\n",
			s:"(\\d{2})"
		},
		n:{
			g:1,
			c:"m = parseInt(results[{0}], 10) - 1;\n",
			s:"(\\d{1,2})"
		},
		t:{
			g:0,
			c:null,
			s:"(?:\\d{2})"
		},
		L:{
			g:0,
			c:null,
			s:"(?:1|0)"
		},
		o:function(){
			return $f("Y");
		},
		Y:{
			g:1,
			c:"y = parseInt(results[{0}], 10);\n",
			s:"(\\d{4})"
		},
		y:{
			g:1,
			c:"var ty = parseInt(results[{0}], 10);\n"
				+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
			s:"(\\d{1,2})"
		},
		a:{
			g:1,
			c:"if (results[{0}] == 'am') {\n"
				+"if (h == 12) { h = 0; }\n"
				+"} else { if (h < 12) { h += 12; }}",
			s:"(am|pm)"
		},
		A:{
			g:1,
			c:"if (results[{0}] == 'AM') {\n"
				+"if (h == 12) { h = 0; }\n"
				+"} else { if (h < 12) { h += 12; }}",
			s:"(AM|PM)"
		},
		g:function(){
			return $f("G");
		},
		G:{
			g:1,
			c:"h = parseInt(results[{0}], 10);\n",
			s:"(\\d{1,2})"
		},
		h:function(){
			return $f("H");
		},
		H:{
			g:1,
			c:"h = parseInt(results[{0}], 10);\n",
			s:"(\\d{2})"
		},
		i:{
			g:1,
			c:"i = parseInt(results[{0}], 10);\n",
			s:"(\\d{2})"
		},
		s:{
			g:1,
			c:"s = parseInt(results[{0}], 10);\n",
			s:"(\\d{2})"
		},
		u:{
			g:1,
			c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
			s:"(\\d+)"
		},
		O:{
			g:1,
			c:[
				"o = results[{0}];",
				"var sn = o.substring(0,1),",
					"hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
					"mn = o.substring(3,5) % 60;",
				"o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"
			].join("\n"),
			s:"([+\-]\\d{4})"
		},
		P:{
			g:1,
			c:[
				"o = results[{0}];",
				"var sn = o.substring(0,1),",
					"hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
					"mn = o.substring(4,6) % 60;",
				"o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"
			].join("\n"),
			s:"([+\-]\\d{2}:\\d{2})"
		},
		T:{
			g:0,
			c:null,
			s:"[A-Z]{1,4}"
		},
		Z:{
			g:1,
			c:"zz = results[{0}] * 1;\n"
				+"zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
			s:"([+\-]?\\d{1,5})"
		},
		c:function(){
			var calc=[],
				arr=[
					$f("Y",1),
					$f("m",2),
					$f("d",3),
					$f("h",4),
					$f("i",5),
					$f("s",6),
					{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},
					{c:[
						"if(results[8]) {",
							"if(results[8] == 'Z'){",
								"zz = 0;",
							"}else if (results[8].indexOf(':') > -1){",
								$f("P",8).c,
							"}else{",
								$f("O",8).c,
							"}",
						"}"
					].join('\n')}
				];
			for(var i=0,l=arr.length;i<l;++i){
				calc.push(arr[i].c);
			}
			return{
				g:1,
				c:calc.join(""),
				s:[
					arr[0].s,
					"(?:","-",arr[1].s,
						"(?:","-",arr[2].s,
							"(?:",
								"(?:T| )?",
								arr[3].s,":",arr[4].s,
								"(?::",arr[5].s,")?",
								"(?:(?:\\.|,)(\\d+))?",
								"(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
							")?",
						")?",
					")?"
				].join("")
			}
		},
		U:{
			g:1,
			c:"u = parseInt(results[{0}], 10);\n",
			s:"(-?\\d+)"
		}
	}});}());
Ext.apply(Date.prototype,{
	dateFormat:function(format){
		if(Date.formatFunctions[format]==null){
			Date.createFormat(format);
		}
		return Date.formatFunctions[format].call(this);
	},
	getTimezone:function(){
		return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"");
	},
	getGMTOffset:function(colon){
		return(this.getTimezoneOffset()>0?"-":"+")
			+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")
			+(colon?":":"")
			+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0");
	},
	getDayOfYear:function(){
		var i=0,
			num=0,
			d=this.clone(),
			m=this.getMonth();
		for(i=0,d.setMonth(0);i<m;d.setMonth(++i)){
			num+=d.getDaysInMonth();
		}
		return num+this.getDate()-1;
	},
	getWeekOfYear:function(){
		var ms1d=864e5,
			ms7d=7*ms1d;
		return function(){
			var DC3=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/ms1d,
				AWN=Math.floor(DC3/7),
				Wyr=new Date(AWN*ms7d).getUTCFullYear();
			return AWN-Math.floor(Date.UTC(Wyr,0,7)/ms7d)+1;
		}
	}(),
	isLeapYear:function(){
		var year=this.getFullYear();
		return!!((year&3)==0&&(year%100||(year%400==0&&year)));
	},
	getFirstDayOfMonth:function(){
		var day=(this.getDay()-(this.getDate()-1))%7;
		return(day<0)?(day+7):day;
	},
	getLastDayOfMonth:function(){
		return this.getLastDateOfMonth().getDay();
	},
	getFirstDateOfMonth:function(){
		return new Date(this.getFullYear(),this.getMonth(),1);
	},
	getLastDateOfMonth:function(){
		return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth());
	},
	getDaysInMonth:function(){
		var daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];
		return function(){
			var m=this.getMonth();
			return m==1&&this.isLeapYear()?29:daysInMonth[m];
		}
	}(),
	getSuffix:function(){
		switch(this.getDate()){
			case 1:
			case 21:
			case 31:
				return"st";
			case 2:
			case 22:
				return"nd";
			case 3:
			case 23:
				return"rd";
			default:
				return"th";
		}
	},
	clone:function(){
		return new Date(this.getTime());
	},
	isDST:function(){
		return new Date(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset();
	},
	clearTime:function(clone){
		if(clone){
			return this.clone().clearTime();
		}
		var d=this.getDate();
		this.setHours(0);
		this.setMinutes(0);
		this.setSeconds(0);
		this.setMilliseconds(0);
		if(this.getDate()!=d){
			for(var hr=1,c=this.add(Date.HOUR,hr);c.getDate()!=d;hr++,c=this.add(Date.HOUR,hr));
			this.setDate(d);
			this.setHours(c.getHours());
		}
		return this;
	},
	add:function(interval,value){
		var d=this.clone();
		if(!interval||value===0)return d;
		switch(interval.toLowerCase()){
			case Date.MILLI:
				d.setMilliseconds(this.getMilliseconds()+value);
				break;
			case Date.SECOND:
				d.setSeconds(this.getSeconds()+value);
				break;
			case Date.MINUTE:
				d.setMinutes(this.getMinutes()+value);
				break;
			case Date.HOUR:
				d.setHours(this.getHours()+value);
				break;
			case Date.DAY:
				d.setDate(this.getDate()+value);
				break;
			case Date.MONTH:
				var day=this.getDate();
				if(day>28){
					day=Math.min(day,this.getFirstDateOfMonth().add('mo',value).getLastDateOfMonth().getDate());
				}
				d.setDate(day);
				d.setMonth(this.getMonth()+value);
				break;
			case Date.YEAR:
				d.setFullYear(this.getFullYear()+value);
				break;
		}
		return d;
	},
	between:function(start,end){
		var t=this.getTime();
		return start.getTime()<=t&&t<=end.getTime();
	}});
Date.prototype.format=Date.prototype.dateFormat;
if(Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420){
	Ext.apply(Date.prototype,{
		_xMonth:Date.prototype.setMonth,
		_xDate:Date.prototype.setDate,
		setMonth:function(num){
			if(num<=-1){
				var n=Math.ceil(-num),
					back_year=Math.ceil(n/12),
					month=(n%12)?12-n%12:0;
				this.setFullYear(this.getFullYear()-back_year);
				return this._xMonth(month);
			}else{
				return this._xMonth(num);
			}
		},
		setDate:function(d){
			return this.setTime(this.getTime()-(this.getDate()-d)*864e5);
		}
	});}
Ext.util.DelayedTask=function(fn,scope,args){
	var me=this,
		id,
		call=function(){
			clearInterval(id);
			id=null;
			fn.apply(scope,args||[]);
		};
	me.delay=function(delay,newFn,newScope,newArgs){
		me.cancel();
		fn=newFn||fn;
		scope=newScope||scope;
		args=newArgs||args;
		id=setInterval(call,delay);
	};
	me.cancel=function(){
		if(id){
			clearInterval(id);
			id=null;
		}
	};};
Ext.util.MixedCollection=function(allowFunctions,keyFn){
	this.items=[];
	this.map={};
	this.keys=[];
	this.length=0;
	this.addEvents(
		"clear",
		"add",
		"replace",
		"remove",
		"sort"
	);
	this.allowFunctions=allowFunctions===true;
	if(keyFn){
		this.getKey=keyFn;
	}
	Ext.util.MixedCollection.superclass.constructor.call(this);};
Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{
	allowFunctions:false,
	add:function(key,o){
		if(arguments.length==1){
			o=arguments[0];
			key=this.getKey(o);
		}
		if(typeof key!='undefined'&&key!==null){
			var old=this.map[key];
			if(typeof old!='undefined'){
				return this.replace(key,o);
			}
			this.map[key]=o;
		}
		this.length++;
		this.items.push(o);
		this.keys.push(key);
		this.fireEvent('add',this.length-1,o,key);
		return o;
	},
	getKey:function(o){
		 return o.id;
	},
	replace:function(key,o){
		if(arguments.length==1){
			o=arguments[0];
			key=this.getKey(o);
		}
		var old=this.map[key];
		if(typeof key=="undefined"||key===null||typeof old=="undefined"){
			 return this.add(key,o);
		}
		var index=this.indexOfKey(key);
		this.items[index]=o;
		this.map[key]=o;
		this.fireEvent("replace",key,old,o);
		return o;
	},
	addAll:function(objs){
		if(arguments.length>1||Ext.isArray(objs)){
			var args=arguments.length>1?arguments:objs;
			for(var i=0,len=args.length;i<len;i++){
				this.add(args[i]);
			}
		}else{
			for(var key in objs){
				if(this.allowFunctions||typeof objs[key]!="function"){
					this.add(key,objs[key]);
				}
			}
		}
	},
	each:function(fn,scope){
		var items=[].concat(this.items);
		for(var i=0,len=items.length;i<len;i++){
			if(fn.call(scope||items[i],items[i],i,len)===false){
				break;
			}
		}
	},
	eachKey:function(fn,scope){
		for(var i=0,len=this.keys.length;i<len;i++){
			fn.call(scope||window,this.keys[i],this.items[i],i,len);
		}
	},
	find:function(fn,scope){
		for(var i=0,len=this.items.length;i<len;i++){
			if(fn.call(scope||window,this.items[i],this.keys[i])){
				return this.items[i];
			}
		}
		return null;
	},
	insert:function(index,key,o){
		if(arguments.length==2){
			o=arguments[1];
			key=this.getKey(o);
		}
		if(this.containsKey(key)){
			this.suspendEvents();
			this.removeKey(key);
			this.resumeEvents();
		}
		if(index>=this.length){
			return this.add(key,o);
		}
		this.length++;
		this.items.splice(index,0,o);
		if(typeof key!="undefined"&&key!==null){
			this.map[key]=o;
		}
		this.keys.splice(index,0,key);
		this.fireEvent("add",index,o,key);
		return o;
	},
	remove:function(o){
		return this.removeAt(this.indexOf(o));
	},
	removeAt:function(index){
		if(index<this.length&&index>=0){
			this.length--;
			var o=this.items[index];
			this.items.splice(index,1);
			var key=this.keys[index];
			if(typeof key!="undefined"){
				delete this.map[key];
			}
			this.keys.splice(index,1);
			this.fireEvent("remove",o,key);
			return o;
		}
		return false;
	},
	removeKey:function(key){
		return this.removeAt(this.indexOfKey(key));
	},
	getCount:function(){
		return this.length;
	},
	indexOf:function(o){
		return this.items.indexOf(o);
	},
	indexOfKey:function(key){
		return this.keys.indexOf(key);
	},
	item:function(key){
		var mk=this.map[key],
			item=mk!==undefined?mk:(typeof key=='number')?this.items[key]:undefined;
		return!Ext.isFunction(item)||this.allowFunctions?item:null;
	},
	itemAt:function(index){
		return this.items[index];
	},
	key:function(key){
		return this.map[key];
	},
	contains:function(o){
		return this.indexOf(o)!=-1;
	},
	containsKey:function(key){
		return typeof this.map[key]!="undefined";
	},
	clear:function(){
		this.length=0;
		this.items=[];
		this.keys=[];
		this.map={};
		this.fireEvent("clear");
	},
	first:function(){
		return this.items[0];
	},
	last:function(){
		return this.items[this.length-1];
	},
	_sort:function(property,dir,fn){
		var i,
			len,
			dsc=String(dir).toUpperCase()=="DESC"?-1:1,
			c=[],k=this.keys,items=this.items;
		fn=fn||function(a,b){
			return a-b;
		};
		for(i=0,len=items.length;i<len;i++){
			c[c.length]={key:k[i],value:items[i],index:i};
		}
		c.sort(function(a,b){
			var v=fn(a[property],b[property])*dsc;
			if(v===0){
				v=(a.index<b.index?-1:1);
			}
			return v;
		});
		for(i=0,len=c.length;i<len;i++){
			items[i]=c[i].value;
			k[i]=c[i].key;
		}
		this.fireEvent("sort",this);
	},
	sort:function(dir,fn){
		this._sort("value",dir,fn);
	},
	keySort:function(dir,fn){
		this._sort("key",dir,fn||function(a,b){
			var v1=String(a).toUpperCase(),v2=String(b).toUpperCase();
			return v1>v2?1:(v1<v2?-1:0);
		});
	},
	getRange:function(start,end){
		var items=this.items;
		if(items.length<1){
			return[];
		}
		start=start||0;
		end=Math.min(typeof end=="undefined"?this.length-1:end,this.length-1);
		var i,r=[];
		if(start<=end){
			for(i=start;i<=end;i++){
				r[r.length]=items[i];
			}
		}else{
			for(i=start;i>=end;i--){
				r[r.length]=items[i];
			}
		}
		return r;
	},
	filter:function(property,value,anyMatch,caseSensitive){
		if(Ext.isEmpty(value,false)){
			return this.clone();
		}
		value=this.createValueMatcher(value,anyMatch,caseSensitive);
		return this.filterBy(function(o){
			return o&&value.test(o[property]);
		});
	},
	filterBy:function(fn,scope){
		var r=new Ext.util.MixedCollection();
		r.getKey=this.getKey;
		var k=this.keys,it=this.items;
		for(var i=0,len=it.length;i<len;i++){
			if(fn.call(scope||this,it[i],k[i])){
				r.add(k[i],it[i]);
			}
		}
		return r;
	},
	findIndex:function(property,value,start,anyMatch,caseSensitive){
		if(Ext.isEmpty(value,false)){
			return-1;
		}
		value=this.createValueMatcher(value,anyMatch,caseSensitive);
		return this.findIndexBy(function(o){
			return o&&value.test(o[property]);
		},null,start);
	},
	findIndexBy:function(fn,scope,start){
		var k=this.keys,it=this.items;
		for(var i=(start||0),len=it.length;i<len;i++){
			if(fn.call(scope||this,it[i],k[i])){
				return i;
			}
		}
		return-1;
	},
	createValueMatcher:function(value,anyMatch,caseSensitive){
		if(!value.exec){
			value=String(value);
			value=new RegExp((anyMatch===true?'':'^')+Ext.escapeRe(value),caseSensitive?'':'i');
		}
		return value;
	},
	clone:function(){
		var r=new Ext.util.MixedCollection();
		var k=this.keys,it=this.items;
		for(var i=0,len=it.length;i<len;i++){
			r.add(k[i],it[i]);
		}
		r.getKey=this.getKey;
		return r;
	}});
Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;
Ext.util.JSON=new(function(){
	var useHasOwn=!!{}.hasOwnProperty,
		isNative=function(){
			var useNative=null;
			return function(){
				if(useNative===null){
					useNative=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=='[object JSON]';
				}
				return useNative;
			};
		}(),
		pad=function(n){
			return n<10?"0"+n:n;
		},
		doDecode=function(json){
			return eval("("+json+')');
		},
		doEncode=function(o){
			if(typeof o=="undefined"||o===null){
				return"null";
			}else if(Ext.isArray(o)){
				return encodeArray(o);
			}else if(Object.prototype.toString.apply(o)==='[object Date]'){
				return Ext.util.JSON.encodeDate(o);
			}else if(typeof o=="string"){
				return encodeString(o);
			}else if(typeof o=="number"){
				return isFinite(o)?String(o):"null";
			}else if(typeof o=="boolean"){
				return String(o);
			}else{
				var a=["{"],b,i,v;
				for(i in o){
					if(!useHasOwn||o.hasOwnProperty(i)){
						v=o[i];
						switch(typeof v){
						case"undefined":
						case"function":
						case"unknown":
							break;
						default:
							if(b){
								a.push(',');
							}
							a.push(doEncode(i),":",
									v===null?"null":doEncode(v));
							b=true;
						}
					}
				}
				a.push("}");
				return a.join("");
			}
		},
		m={
			"\b":'\\b',
			"\t":'\\t',
			"\n":'\\n',
			"\f":'\\f',
			"\r":'\\r',
			'"':'\\"',
			"\\":'\\\\'
		},
		encodeString=function(s){
			if(/["\\\x00-\x1f]/.test(s)){
				return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){
					var c=m[b];
					if(c){
						return c;
					}
					c=b.charCodeAt();
					return"\\u00"+
						Math.floor(c/16).toString(16)+
						(c%16).toString(16);
				})+'"';
			}
			return'"'+s+'"';
		},
		encodeArray=function(o){
			var a=["["],b,i,l=o.length,v;
				for(i=0;i<l;i+=1){
					v=o[i];
					switch(typeof v){
						case"undefined":
						case"function":
						case"unknown":
							break;
						default:
							if(b){
								a.push(',');
							}
							a.push(v===null?"null":Ext.util.JSON.encode(v));
							b=true;
					}
				}
				a.push("]");
				return a.join("");
		};
	this.encodeDate=function(o){
		return'"'+o.getFullYear()+"-"+
				pad(o.getMonth()+1)+"-"+
				pad(o.getDate())+"T"+
				pad(o.getHours())+":"+
				pad(o.getMinutes())+":"+
				pad(o.getSeconds())+'"';
	};
	this.encode=function(){
		var ec;
		return function(o){
			if(!ec){
				ec=isNative()?JSON.stringify:doEncode;
			}
			return ec(o);
		};
	}();
	this.decode=function(){
		var dc;
		return function(json){
			if(!dc){
				dc=isNative()?JSON.parse:doDecode;
			}
			return dc(json);
		};
	}();})();
Ext.encode=Ext.util.JSON.encode;
Ext.decode=Ext.util.JSON.decode;
Ext.util.Format=function(){
	var trimRe=/^\s+|\s+$/g;
	return{
		ellipsis:function(value,len,word){
			if(value&&value.length>len){
				if(word){
					var vs=value.substr(0,len-2);
					var index=Math.max(vs.lastIndexOf(' '),vs.lastIndexOf('.'),vs.lastIndexOf('!'),vs.lastIndexOf('?'));
					if(index==-1||index<(len-15)){
						return value.substr(0,len-3)+"...";
					}else{
						return vs.substr(0,index)+"...";
					}
				}else{
					return value.substr(0,len-3)+"...";
				}
			}
			return value;
		},
		undef:function(value){
			return value!==undefined?value:"";
		},
		defaultValue:function(value,defaultValue){
			return value!==undefined&&value!==''?value:defaultValue;
		},
		htmlEncode:function(value){
			return!value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;");
		},
		htmlDecode:function(value){
			return!value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&");
		},
		trim:function(value){
			return String(value).replace(trimRe,"");
		},
		substr:function(value,start,length){
			return String(value).substr(start,length);
		},
		lowercase:function(value){
			return String(value).toLowerCase();
		},
		uppercase:function(value){
			return String(value).toUpperCase();
		},
		capitalize:function(value){
			return!value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase();
		},
		call:function(value,fn){
			if(arguments.length>2){
				var args=Array.prototype.slice.call(arguments,2);
				args.unshift(value);
				return eval(fn).apply(window,args);
			}else{
				return eval(fn).call(window,value);
			}
		},
		usMoney:function(v){
			v=(Math.round((v-0)*100))/100;
			v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);
			v=String(v);
			var ps=v.split('.');
			var whole=ps[0];
			var sub=ps[1]?'.'+ps[1]:'.00';
			var r=/(\d+)(\d{3})/;
			while(r.test(whole)){
				whole=whole.replace(r,'$1'+','+'$2');
			}
			v=whole+sub;
			if(v.charAt(0)=='-'){
				return'-$'+v.substr(1);
			}
			return"$"+v;
		},
		date:function(v,format){
			if(!v){
				return"";
			}
			if(!Ext.isDate(v)){
				v=new Date(Date.parse(v));
			}
			return v.dateFormat(format||"m/d/Y");
		},
		dateRenderer:function(format){
			return function(v){
				return Ext.util.Format.date(v,format);
			};
		},
		stripTagsRE:/<\/?[^>]+>/gi,
		stripTags:function(v){
			return!v?v:String(v).replace(this.stripTagsRE,"");
		},
		stripScriptsRe:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
		stripScripts:function(v){
			return!v?v:String(v).replace(this.stripScriptsRe,"");
		},
		fileSize:function(size){
			if(size<1024){
				return size+" bytes";
			}else if(size<1048576){
				return(Math.round(((size*10)/1024))/10)+" KB";
			}else{
				return(Math.round(((size*10)/1048576))/10)+" MB";
			}
		},
		math:function(){
			var fns={};
			return function(v,a){
				if(!fns[a]){
					fns[a]=new Function('v','return v '+a+';');
				}
				return fns[a](v);
			}
		}(),
		round:function(value,precision){
			var result=Number(value);
			if(typeof precision=='number'){
				precision=Math.pow(10,precision);
				result=Math.round(value*precision)/precision;
			}
			return result;
		},
		number:function(v,format){
			if(!format){
				return v;
			}
			v=Ext.num(v,NaN);
			if(isNaN(v)){
				return'';
			}
			var comma=',',
				dec='.',
				i18n=false,
				neg=v<0;
			v=Math.abs(v);
			if(format.substr(format.length-2)=='/i'){
				format=format.substr(0,format.length-2);
				i18n=true;
				comma='.';
				dec=',';
			}
			var hasComma=format.indexOf(comma)!=-1,
				psplit=(i18n?format.replace(/[^\d\,]/g,''):format.replace(/[^\d\.]/g,'')).split(dec);
			if(1<psplit.length){
				v=v.toFixed(psplit[1].length);
			}else if(2<psplit.length){
				throw('NumberFormatException: invalid format, formats should have no more than 1 period: '+format);
			}else{
				v=v.toFixed(0);
			}
			var fnum=v.toString();
			if(hasComma){
				psplit=fnum.split('.');
				var cnum=psplit[0],parr=[],j=cnum.length,m=Math.floor(j/3),n=cnum.length%3||3;
				for(var i=0;i<j;i+=n){
					if(i!=0){
						n=3;
					}
					parr[parr.length]=cnum.substr(i,n);
					m-=1;
				}
				fnum=parr.join(comma);
				if(psplit[1]){
					fnum+=dec+psplit[1];
				}
			}
			return(neg?'-':'')+format.replace(/[\d,?\.?]+/,fnum);
		},
		numberRenderer:function(format){
			return function(v){
				return Ext.util.Format.number(v,format);
			};
		},
		plural:function(v,s,p){
			return v+' '+(v==1?s:(p?p:s+'s'));
		},
		nl2br:function(v){
			return v===undefined||v===null?'':v.replace(/\n/g,'<br/>');
		}
	}}();
Ext.XTemplate=function(){
	Ext.XTemplate.superclass.constructor.apply(this,arguments);
	var me=this,
		s=me.html,
		re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,
		nameRe=/^<tpl\b[^>]*?for="(.*?)"/,
		ifRe=/^<tpl\b[^>]*?if="(.*?)"/,
		execRe=/^<tpl\b[^>]*?exec="(.*?)"/,
		m,
		id=0,
		tpls=[],
		VALUES='values',
		PARENT='parent',
		XINDEX='xindex',
		XCOUNT='xcount',
		RETURN='return ',
		WITHVALUES='with(values){ ';
	s=['<tpl>',s,'</tpl>'].join('');
	while((m=s.match(re))){
	 	var m2=m[0].match(nameRe),
			m3=m[0].match(ifRe),
	 		m4=m[0].match(execRe),
	 		exp=null,
	 		fn=null,
	 		exec=null,
	 		name=m2&&m2[1]?m2[1]:'';
	 if(m3){
		 exp=m3&&m3[1]?m3[1]:null;
		 if(exp){
			 fn=new Function(VALUES,PARENT,XINDEX,XCOUNT,WITHVALUES+RETURN+(Ext.util.Format.htmlDecode(exp))+'; }');
		}
	}
	 if(m4){
		 exp=m4&&m4[1]?m4[1]:null;
		 if(exp){
			 exec=new Function(VALUES,PARENT,XINDEX,XCOUNT,WITHVALUES+(Ext.util.Format.htmlDecode(exp))+'; }');
		}
	}
	 if(name){
		 switch(name){
			 case'.':name=new Function(VALUES,PARENT,WITHVALUES+RETURN+VALUES+'; }');break;
			 case'..':name=new Function(VALUES,PARENT,WITHVALUES+RETURN+PARENT+'; }');break;
			 default:name=new Function(VALUES,PARENT,WITHVALUES+RETURN+name+'; }');
		}
	}
	 tpls.push({
			id:id,
			target:name,
			exec:exec,
			test:fn,
			body:m[1]||''
		});
	 s=s.replace(m[0],'{xtpl'+id+'}');
	++id;
	}
	Ext.each(tpls,function(t){
		me.compileTpl(t);
	});
	me.master=tpls[tpls.length-1];
	me.tpls=tpls;};
Ext.extend(Ext.XTemplate,Ext.Template,{
	re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
	codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,
	applySubTemplate:function(id,values,parent,xindex,xcount){
		var me=this,
			len,
			t=me.tpls[id],
			vs,
			buf=[];
		if((t.test&&!t.test.call(me,values,parent,xindex,xcount))||
			(t.exec&&t.exec.call(me,values,parent,xindex,xcount))){
			return'';
		}
		vs=t.target?t.target.call(me,values,parent):values;
		len=vs.length;
		parent=t.target?values:parent;
		if(t.target&&Ext.isArray(vs)){
			Ext.each(vs,function(v,i){
				buf[buf.length]=t.compiled.call(me,v,parent,i+1,len);
			});
			return buf.join('');
		}
		return t.compiled.call(me,vs,parent,xindex,xcount);
	},
	compileTpl:function(tpl){
		var fm=Ext.util.Format,
	 		useF=this.disableFormats!==true,
			sep=Ext.isGecko?"+":",",
			body;
		function fn(m,name,format,args,math){
			if(name.substr(0,4)=='xtpl'){
				return"'"+sep+'this.applySubTemplate('+name.substr(4)+', values, parent, xindex, xcount)'+sep+"'";
			}
			var v;
			if(name==='.'){
				v='values';
			}else if(name==='#'){
				v='xindex';
			}else if(name.indexOf('.')!=-1){
				v=name;
			}else{
				v="values['"+name+"']";
			}
			if(math){
				v='('+v+math+')';
			}
			if(format&&useF){
				args=args?','+args:"";
				if(format.substr(0,5)!="this."){
					format="fm."+format+'(';
				}else{
					format='this.call("'+format.substr(5)+'", ';
					args=", values";
				}
			}else{
				args='';format="("+v+" === undefined ? '' : ";
			}
			return"'"+sep+format+v+args+")"+sep+"'";
		}
		function codeFn(m,code){
			return"'"+sep+'('+code+')'+sep+"'";
		}
		if(Ext.isGecko){
			body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+
				 tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+
					"';};";
		}else{
			body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];
			body.push(tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));
			body.push("'].join('');};");
			body=body.join('');
		}
		eval(body);
		return this;
	},
	applyTemplate:function(values){
		return this.master.compiled.call(this,values,{},1,1);
	},
	compile:function(){return this;}
	});
Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;